Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Workbook Activate Event not fired.

Status
Not open for further replies.

hartfield

Programmer
Mar 8, 2002
1
GB
I am using Excel 2000 running on Windows 2000 Professional.

I have some code in a workbook activate event that needs to run every time the event is fired. This works fine with multiple workbooks in memory using the Windows menu option in Excel to move between workbooks. The problem is that it does not work when a workbook is selected from the taskbar or when using 'Alt' 'Tab' with the 'Windows in Taskbar' feature enabled. The deactivate event occurs when another workbook is selected, but the activate event appears to be disabled when returning to the workbook with the code in it.

Has anybody got any ideas?



 
Hi,
How many Excel applications do you have open? Within any Excel application, activating and deactivating works and can only be done within the Window Menu item. Selecting from the taskbar, selects a separate Excel application which is isolated from any other Excel application.

Does this make sense? Skip,
metzgsk@voughtaircraft.com
 
Skip,

From Excel 2000 onwards you can have more than one workbook show in the taskbar, even if there is only one instance of excel running. This can be set via Tools, Options, View and checking Windows in Taskbar.

The WindowActivate event should fire when selected from the taskbar or from Alt Tab, and does for me.

Check that Application.EnableEvents is set to True.

AC
 
acron,
Thanx for the info. I was not aware of that option.

However, in light of the question at hand, the Workbook_Activate event fails to fire for me ONLY when selecting from the Alt+Tab selecting from one Excel workbook to another. The TaskBar select fires the event and if I use alt+Tab, it WILL fire if I select an application other than Excel between selections.

Is this a Windows undocumented feature? Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top