Navigate explorer with vba: error 91

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

I need a help to improuve my work for navigating explorer via vba. Sure something has to be modified, but the true problem is the line associated to Runtime Error 91: object variable or with block variable not set., trying to click the button2.

Code:
 [B]InputClick2.Click[/B]





Code:
Sub Site()

Dim IE As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim InputText As HTMLInputElement
Dim InputClick As HTMLInputElement
Dim InputClick2 As HTMLInputElement

   IE.Navigate "http://xxxxxxxxxxxxxxxxxxx.ASPX"

   IE.Visible = True

WaitIE IE 

   Set IEDoc = IE.document
   
   Set InputText = IEDoc.all("input")
   
   InputText.Value = "12345678"


      Set InputClick = IEDoc.all("button")

      InputClick.Click


WaitIE IE 

      Set InputClick2 = IEDoc.all("button2")

      [B]InputClick2.Click[/B]



WaitIE IE 


End Sub


Could anyone get me some hints?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I'm struggling.

This is the button (with no "id"). How can I identify it?


<button type="submit" class="btn btn-primary" name="Action" value="validate IBAN, look up BIC" title=" validate IBAN, look up BIC ">validate IBAN, look up BIC</button>
 
Last edited:
Upvote 0
Well, probably is the only form in the page.

This works:

Code:
IE.document.forms(0).submit
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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