KeepTrying
Active Member
- Joined
- Aug 19, 2012
- Messages
- 276
- Office Version
- 365
- 2010
- Platform
- Windows
Dear Experts,
I'd like to run macros on a Web page but as far as I know this is not possible or quite difficult. So I want to at least imitate it. My idea: create a userform, show a Web page on it then detect if e.g. a button was clicked on that Web page on the userform. Then run a macro after clicking (like click event).
I know if I add a "WebBrowser1" control I can easily show a Web page on a userform. Sample code:
But how can I trigger if a button was clicked on that Web page on the userform? I know that controlling Web page is possible from VBA (by creating object called "InternetExplorer.Application") but my question is different.
Web page in the VBA code can be different of course.
Thank you in advance for your help.
Regards,
KeepTrying
I'd like to run macros on a Web page but as far as I know this is not possible or quite difficult. So I want to at least imitate it. My idea: create a userform, show a Web page on it then detect if e.g. a button was clicked on that Web page on the userform. Then run a macro after clicking (like click event).
I know if I add a "WebBrowser1" control I can easily show a Web page on a userform. Sample code:
Code:
Private Sub UserForm_Initialize()
With Me.WebBrowser1
.Navigate "https://www.wikipedia.org/"
.Width = Application.Width
.Height = Application.Height
.Top = Application.Top
.Left = Application.Left
End With
End Sub
But how can I trigger if a button was clicked on that Web page on the userform? I know that controlling Web page is possible from VBA (by creating object called "InternetExplorer.Application") but my question is different.
Web page in the VBA code can be different of course.
Thank you in advance for your help.
Regards,
KeepTrying
Last edited: