I want to trap several events associated with shDocVw.InternetExplorer.
At first I tried to declare an Internet Explorer object variable in the declarations section of a standard module as follows:
Public WithEvents Explorer As SHDocVw.InternetExplorer
This got me the error message "Only valid in object module", highlighting the "WithEvents" statement. So I created a class module instead, "clsMyExplorer", and typed the following in the declarations section:
Public WithEvents myExplorer As shdocvw.InternetExplorer
I then tried to create an instance of this class in a standard module:
Declarations Section: Public myIE As clsMyExplorer
Sub DoThis(): Set myIE.myExplorer = shdocvw.InternetExplorer
However it doesn't work, but I'm sure I'm almost there. Can someone help?