Chacanger
Programmer
- Feb 22, 2011
- 7
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.
If anyone can help I would be very greatfull.
Thanks
Chacanger
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