Need VBA code to execute JavaScript.

g8rbroker

New Member
Joined
Sep 3, 2008
Messages
15
Hi All,

I need VBA code to execute JavaScript. The website I am working on has you put in an account number, then it asks you to click a link called view my account. I have written code to input the account number, but the code that I wrote to click the link does not work properly. I clicks the link, but evidently does not run the javascript. I know this because it tells me the account number is invalid. The source code for the link is below.

a href="javascript:CheckAndS<WBR>ubmit( document.frmViewMyAcct )">View My Account

The code that I have that clicks the clink is:

IE.document.frmviewmyacct.<WBR>submit

Which I know is incorrect.

Any help would be greatly appreciated. Thanks in advance.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The Window object has a method 'execScript' you could use.

Code:
IE.Document.parentWindow.execScript "CheckAndSubmit(document.frmViewMyAcct);"
 
Upvote 0

Forum statistics

Threads
1,215,419
Messages
6,124,796
Members
449,189
Latest member
kristinh

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