VBA and HTML/JavaScript next step ideas


New Member
Feb 17, 2016
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.

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...