Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorkBook Deactivate Event faffo1980 Excel Programming 2 October 7th 09 10:35 AM
When does the Workbook_Open event occur? Conan Kelly Excel Programming 2 August 9th 06 11:45 PM
Workbook Deactivate event problem Jeremy Strom Excel Programming 1 May 24th 06 11:04 PM
VBA problem - prevent event to occur when certain button is clicked blackpablo Excel Programming 0 August 5th 04 10:21 AM
Workbook Deactivate Event TerryF[_2_] Excel Programming 1 January 6th 04 02:16 AM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"