Filling out usernames in IE
As Paul D mentioned earlier, it is possible to launch IE from within VBA
(Code at the end)
Is it possible to input a username as well?
I am most interested on this one.
I know how to do it with Visual Basic Express and the webbrowser control,
but that is not good because I do not want to recreate a new browser, I want
to use IE.
Thanks,
Antonio
Public Sub CheckIE()
Dim objSW As SHDocVw.ShellWindows
Dim objIE As SHDocVw.InternetExplorer
Dim objDoc As Object
Dim bAppRunning As Boolean
'Set objSW = New SHDocVw.ShellWindows
If objSW.Count Then ' new
For Each objDoc In objSW
If InStr(1, objDoc.LocationName, "Google") Then
bAppRunning = True
objDoc.Visible = True
Exit For
End If
Next objDoc
End If
If bAppRunning = False Then
Set objIE = CreateObject("InternetExplorer.Application") ' new
objIE.Visible = True
objIE.Navigate "www.google.com"
End If
Set objIE = Nothing
Set objSW = Nothing
End Sub
Paul D
|