Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unamed buttons in Web Page ie automation

Status
Not open for further replies.

Chacanger

Programmer
Feb 22, 2011
7
0
0
Hello there

I have a query regarding automating buttons in VBA (Excel), I have been trying to automate pressing a button in a page, normally this would be fine for me to do by doing something like ie.Document.getelementbyid("a_button").Click, unfortunately the page I am currently trying to automate has a button with no name, I looked at the source code of the webpage and it doesn’t contain one.

Unfortunately I can't show the webpage on here as it is an internal Intranet site. I was wondering if there is a way I can get these unnamed buttons to function?

Here is an example of how my code looks at the moment.

Code:
Sub InitiatePage()

Dim ie As InternetExplorer
Set ie = New InternetExplorer

ie.Navigate "website"

Do Until ie.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Do: DoEvents: Loop Until Not ie.Busy

ie.Document.getelementbyid("").Click 'This is the unnamed button.
ie.Visible = True

End Sub

If anyone can help I would be very greatfull.

Thanks

Chacanger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top