Button login in IE with only input type and value as html

D

Deleted member 415602

Guest
Hey guys,

I am currently writhing a code in VBA excel to automate my data entry from a user form to IE. I am easily able to add my data in text box's but I am currently having issues clicking the login button.
Here is the HTML code when I click inspect on the login button itself: <input type="submit" value="Login">
The problem is that there is no ID or name for me to call and click with my VBA code.
Here is my code:
Dim IE As New InternetExplorerMedium
Dim InputUsername As HTMLInputElement
Dim InputPassword As HTMLInputElement
Dim ButtonLogin As HTMLInputButtonElement

IE.navigate "
"
IE.Visible = True

Do While IE.Busy = True Or IE.readyState <> 4: DoEvents: Loop
Set IEDoc = IE.document

Set InputUsername = IEDoc.all("username")
Set InputPassword = IEDoc.all("password")

InputUsername.Value = "test"
InputPassword.Value = "test123"
SendKeys ("{ENTER}")

I am using the "Sendkeys" to login but it is not very effective for work.
How to call a button by just having input type and value... ?
Also, the reason I don't share the work URL is because you won't be able to access it from home unfortunately.

Thank you for your help :)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Sorry,
The code for the login button is: <input type="submit" value="Login" >

I am still learning... sorry if some things doesn't make sense
 
Upvote 0

Forum statistics

Threads
1,216,091
Messages
6,128,775
Members
449,468
Latest member
AGreen17

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