Error 91 with IE object in Excel

M

mfq

I'm getting Error 91 inconsistently when I run my macro. Macro stops
when it reaches the "USERNAME" line. I've tried setting the object to
nothing at the end and also using a fully qualified name. None works.
Anybody have any ideas? Does this have something to do with the browser
object? (I'm using Excel 2000)

Here's my code:
''''''''''''''''''''''''''''''''''''''''''''''''''START''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub FHLBSF()
Dim dFRC(1 To 13, 1 To 3) As Double
Dim ie As Object, ipf As Object, tmpWksht As Object
Dim dDuration As Double, PctDone As Double

' Prepare to open the web page
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False

With ie
.navigate "https://member.fhlbsf.com/member/admin/login.asp?"
Do Until Not .Busy
DoEvents
Loop
End With

' INCONSISTENT ERROR 91 HERE
ie.document.all.Item("UserName").Value = sUName
' ERROR
ie.document.all.Item("Password").Value = sPW
ie.document.all.Item("submitButton").Click

ie.navigate sStandardVRCURL
Do Until Not ie.Busy
DoEvents
Loop

ie.ExecWB 17, 2
ie.ExecWB 12, 0

'Logout
With ie
Set ipf = ie.document.all.Item("menu5")
ipf.Click
End With

ie.Quit
Set ipf = Nothing
Set ie = Nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''END''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
M

mfq1975

Hahaha - about the FBI comment although with the way things have been
developing in the news of late, it wouldn't be totally impossible.
Anyway, thanks for the site reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

little help 16
Runtime error 91 on website login 1
VB Wait 2
Access wab page with excel VBA 4
username and password controls 1
press button "entra" in web page 7
How to use Java in Excel VBA? 1
Web Import 6

Top