NARAYANAN
New Member
- Joined
- May 12, 2017
- Messages
- 2
Dear team
the below code is written to open a URL and post comments.
when i run the code the URL is opening and a debugg is comming mentioning "run time error 91" ( object variable or block variable is not set).
if i open the code and press F5 then the code is resuming correctly.
below is my code:
Public Sub IE_LatLong()
Dim IE As Object
Dim address As String
address = Range("E94").Value
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate Range("E95").Value
While .Busy Or .readyState <> 4: DoEvents: Wend
Const RepeatMinutes = 5 ' Time interval in minutes for repeating of this macro
Const WaitSeconds = 10 ' Waiting time interval in secondss for "IE is ready" state
IE.Document.getElementsByClassname("new_comment_textarea")(0).Value = address
IE.Document.getElementById("submit_new_comment").Click
While .Busy Or .readyState <> 4: DoEvents: Wend
End With
Set IE = Nothing
End Sub
the below code is written to open a URL and post comments.
when i run the code the URL is opening and a debugg is comming mentioning "run time error 91" ( object variable or block variable is not set).
if i open the code and press F5 then the code is resuming correctly.
below is my code:
Public Sub IE_LatLong()
Dim IE As Object
Dim address As String
address = Range("E94").Value
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate Range("E95").Value
While .Busy Or .readyState <> 4: DoEvents: Wend
Const RepeatMinutes = 5 ' Time interval in minutes for repeating of this macro
Const WaitSeconds = 10 ' Waiting time interval in secondss for "IE is ready" state
IE.Document.getElementsByClassname("new_comment_textarea")(0).Value = address
IE.Document.getElementById("submit_new_comment").Click
While .Busy Or .readyState <> 4: DoEvents: Wend
End With
Set IE = Nothing
End Sub