Get Data from a Website - Unable to click Button

karan1

New Member
Joined
Feb 17, 2016
Messages
3
Hello,

I have to download some information from a website, for which I'm trying to use this code:

Code:
        Dim ie As New InternetExplorer
        ie.Navigate "http://mca.gov.in/DCAPortalWeb/dca/MyMCALogin.do?method=setDefaultProperty&mode=31"
        
        Do
        Loop Until ie.ReadyState = READYSTATE_COMPLETE
        
        ie.Document.forms(0).cmpnyID.Value = "U01200PN2014PTC151335" 'To put value in TextBox
        ie.Document.forms(0).submit.Click

I'm getting an error on the line: ie.Document.forms(0).submit.Click. I guess, this is because Submit is not a button, but a Javascript link.

Can anyone help me correct my code here?

Thanks,
Karan
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
There is no such method/property as "submit.Click", hence the error. Instead of submitting the form, you have to click the Submit button because it runs a bit of JavaScript:
Code:
ie.Document.getElementById("Default").Click
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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