I am using a web browser control inside a userform. The web page I am browsing with it generates popups, and I need to take control of the popup (it inserts values into specific fields related to the option that forces the onchange event). Either by using a form or ppDisp. I cannot get ppDisp to work correctly. The easiest way to solve this issue is to get ppDisp to work correctly:
This works only one time. Once the popup closes itself and inserts values into my web browser control, the web browser2 control will not pop up again, so the web browser control needs to create itself on the fly or not let the popup close it out completely. I would also like to see if I can get this on its own form, since some of the popup windows dont have the ability to exit. Using webbrowser2.object instead of application is incorrect and VBA does not like it.
Alternatively, creating a userform solves some of the problems, but it doesnt solve where to put the data which is going to be impossible to figure out, since the form fields load dynamically and arent in a set position. What would you do to solve this?
Code:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim frm As UserForm1
Set frm = UserForm1
Set ppDisp = frm.WebBrowser2.Application
End Sub
This works only one time. Once the popup closes itself and inserts values into my web browser control, the web browser2 control will not pop up again, so the web browser control needs to create itself on the fly or not let the popup close it out completely. I would also like to see if I can get this on its own form, since some of the popup windows dont have the ability to exit. Using webbrowser2.object instead of application is incorrect and VBA does not like it.
Alternatively, creating a userform solves some of the problems, but it doesnt solve where to put the data which is going to be impossible to figure out, since the form fields load dynamically and arent in a set position. What would you do to solve this?