VBA and HTML/JavaScript next step ideas

MarkNalley

New Member
Joined
Feb 17, 2016
Messages
1
Question: I'm looking for ideas or methods on how to handle a child window opened by a JavaScript function on a .aspx webpage. I've run down every rabbit hole I can find and hit a road block each time.

The problem: I have a website that creates orders and part of the webpage requires a button 'Click' event. The 'Click' event fires a JavaScript doPostBack function that builds a popup window where more information is entered and another 'Click' event posts the relevant address information back to the original webpage and refreshes the page (with a slight change to the .aspx address parameters - addition of an ID field). The problem occurs after the first 'Click' event. The VBA script pauses while the JavaScript function runs and isn't resumed until after the second 'Click' event.

Workaround: Run the VBA script to just before the first 'Click', copy the needed information into the clipboard via VBA, fire the first 'Click'. Manually paste the information into the popup window, manually fire the second 'Click' event. This occurs 2-14 times for any given order.

What I've tried:
  • NewWindow withEvents trigger: doesn't work. There is no NewWindow2 event triggered. Ditto for BeforeNavigation2, NewProcess, BeforeScriptExecute or any other InternetExplorer Object event. The events occur at other points in the process but not for the first 'Click' event described above.
  • Looked into XMLHTTP functions but stopped early. Per Wireshark, there are no GET or POST messages IN or OUT during the first 'Click' event. The first POST event occurs after the manual paste of information into the new popup window.

Rabbit Holes I'm currently looking down:
  • Is it possible to edit the JavaScript (spread out over 8 different text files) in the Temporary Internet Files to force a New Window event or is the script held in IE volatile memory.
  • Is it possible to run JavaScript from VBA that will simulate the results of the first 'Click' event.

Why I suck at this: I know almost nothing about ASP and too little about JavaScript to make this easy.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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