getting error 91 when running macro but no error when I debug.

ali_zaheer

New Member
Joined
Oct 1, 2018
Messages
5
Hii,
I'm getting error code 91 object not set while running this sub. while when I debug and go lie by line by pressing F8 it doesnt show any error and run smooth.Please help. i would be really thankful.

Sub systemLogin()




Dim objIE As Object
Dim uName As String
Dim pAss As Variant




uName = Range("B3")
pAss = Range("A3")


Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "http://10.0.12.98:1947/BrowserWeb"
Do Until objIE.readyState = 4
Loop




objIE.document.getElementById("signOnName").Value = uName
objIE.document.getElementById("password").Value = pAss
objIE.document.getElementById("main").Click




End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Maybe make it:

Set uName = Range("B3")
Set Pass = Range("A3")

You never know.
 
Upvote 0
Sounds like a timing, or connection, issue.

Try adding some Application.Waits so the code will wait while the page/document loads in IE.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top