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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,224,821
Messages
6,181,163
Members
453,021
Latest member
Justyna P

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