ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Interacting with Internet Explorer Problem (https://www.excelbanter.com/excel-programming/394397-interacting-internet-explorer-problem.html)

[email protected]

Interacting with Internet Explorer Problem
 
Hi, everyone. I have a macro in Excel that takes user inputs in Excel
and copies them into a form on a web page. I am having trouble
"clicking" on a button on the web page. I tried the following code to
find the button on the page:

For Each l In ie.Document.Links
Debug.Print l.Address
Next l

This code only finds the buttons at the top of the page and the bottom
of the page (i.e, it can't find buttons in the middle section/form).

The html shows the button I am interested in as:

"...onclick="submitForm('DefaultFormName',1,
{'_FORM_SUBMIT_BUTTON':'addrow'});return false"..."

This button adds a row to the form on the web page.

Does anyone have ideas on how I can click this button view VBA in
Excel?

Thanks in advance!
jk


[email protected]

Interacting with Internet Explorer Problem
 
On Jul 30, 9:28 am, wrote:
Hi, everyone. I have a macro in Excel that takes user inputs in Excel
and copies them into a form on a web page. I am having trouble
"clicking" on a button on the web page. I tried the following code to
find the button on the page:

For Each l In ie.Document.Links
Debug.Print l.Address
Next l

This code only finds the buttons at the top of the page and the bottom
of the page (i.e, it can't find buttons in the middle section/form).

The html shows the button I am interested in as:

"...onclick="submitForm('DefaultFormName',1,
{'_FORM_SUBMIT_BUTTON':'addrow'});return false"..."

This button adds a row to the form on the web page.

Does anyone have ideas on how I can click this button view VBA in
Excel?

Thanks in advance!
jk


I wanted to clarify the code above... The for loop is actually

For Each l In ie.Document.Links
Debug.Print l.innerText
Next l

Thanks,
jk



All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com