K
keepITcool
I dont know what you consider 'my object module'
my code is meant to go in the code module of Thisworkbook object.
NOT in a normal module. that was the whole point.
open VBE
double click ThisWorkbook in Project Explorer.
a code pane opens (or is activated) titled:
BookX.xls - ThisWorkbook
my code is meant to go in the code module of Thisworkbook object.
NOT in a normal module. that was the whole point.
open VBE
double click ThisWorkbook in Project Explorer.
a code pane opens (or is activated) titled:
BookX.xls - ThisWorkbook
Code:
copy my code there. (and remove it anywhere else)
now you should be able to use the dropdowns at the top
of the codepane and select the General and the objects workbook and
xlapp
... note if you select xlApp in the LEFT dropdown..
the available events are listed on the Right.
From VBA help:
WithEvents Optional. Keyword that specifies that varname is an object
variable used to respond to events triggered by an ActiveX object.
WithEvents is valid only in class modules.
You can declare as many individual variables as you like using
WithEvents, but you can't create arrays with WithEvents. You can't use
New with WithEvents.
Re 'WithEvents is valid only in class modules.':
modules behind a userform, worksheet or thisworkbook
are defacto classmodules.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
Tempy wrote :