Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Deactivate event seems to occur too late
Just curious, as this has bit me more than once.
Why is the Workbook Deactivate event fired *after* the ActiveWorkbook has already been changed? It makes referencing cells in the "deactivating" workbook unaddressable using simple Ranges. I've had to resort to changing my code from this: set llr = Range("LogLevel") to this: set llr = ThisWorkbook.Sheets("Support").Range("LogLevel") in order to get and set data in the workbook being deactivated. Besides being more complex of an expression, this would also be a problem if needed to change the name of the sheet. Anyone know why the event isn't fired *before* the ActiveWorkbook is changed? Is there an easier or more general way to refer to ranges that is immune to this issue? Can I specify a global named range in another workbook (in this case, ThisWorkbook) without specifying the sheet name? What are best practices for referring to named ranges? Thanks tbone |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WorkBook Deactivate Event | Excel Programming | |||
When does the Workbook_Open event occur? | Excel Programming | |||
Workbook Deactivate event problem | Excel Programming | |||
VBA problem - prevent event to occur when certain button is clicked | Excel Programming | |||
Workbook Deactivate Event | Excel Programming |