Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
.navigate more than one website in only one IE.7 microsoft windows in VBA Excel

In other words, one IE window has three websites or instances I need, please help .
Please advise
Duncan
Sub AllwebsiteIE()
Dim myIE As SHDocVw.InternetExplorer
myIE.visible=True
myIE.navigate "http://www.yahoo.com"
myIE.navigate "http://www.aol.com"
myIE.navigate "http:/www.google.com"
end sub
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If
here you go, use this to call your sub AllwebsiteIE() (you will see it in this code).
It saves the user's current settings, makes IE have the tab setting, then executes your sub, then sets the values back.
Note: I gave this a wscript.sleep for 5 seconds in case it takes IE a minute to open up the tabs properly.
Dim strValueName, oReg, strComputer, strKeyPath, bHasAccessRight, dwValue
Const HKEY_CURRENT_USER = &H80000001
const KEY_QUERY_VALUE = &H0001
const KEY_SET_VALUE = &H0002
strComputer = "."
strValueName = "PopupsUseNewWindow"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" & strComputer & "
ootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftInternet ExplorerTabbedBrowsing"
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.CheckAccess HKEY_CURRENT_USER, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,"2"
AllwebsiteIE()
Wscript.sleep 5000 'in milliseconds
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Set oReg=nothing
End If
End If