Workbook Activate Event

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I am Developing an Excel Dictator App with Multiple Add-Ins and the
possibility of other un-related workbooks in the same Excel session.

I need to find out and use - in the Workbook_WindowActivate "event" sub
of the Dictator Workbook - the name of the Workbook within the same
Excel session that the user has just moved from.

Strangely enough - when I move between the Dictator workbook and an
empty workbook (Book2) - I can see the very info that I need popping up
in the immediate window!
See below the output from the Immediate Window.


WindowDeactivate: Workbook=Dictator.xls, Window=Dictator.xls,
Time=26/07/2006 15:20:15
WorkbookDeactivate: Workbook=Dictator.xls, Time=26/07/2006 15:20:15
WindowDeactivate: Workbook=Book2, Window=Book2, Time=26/07/2006
15:20:18
WorkbookDeactivate: Workbook=Book2, Time=26/07/2006 15:20:18


Can anyone shed any light on this - thanks in advance

Chris
 
You sure you don't have any code that has your debug.print's in them?

I'd check any/all addins that you have running.
 
Dave said:
You sure you don't have any code that has your debug.print's in them?

I'd check any/all addins that you have running.

Dave

That was the first thing I did when I saw those lines! But there's
nothing I can find.
Nor did walking through the Application objects Properties throw up
anything that looks helpful like 'LastCaller' or anything of that ilk.

Thanks anyway

Chris
 
The only time I've seen clutter in the immediate window is when I've put it
there (and from the analysis toolpak addin (someone left some debug.prints in
the code)).

I'd check all the open workbooks/addins once more.
 
Dave

It was - inevitably - something hidden in one of the Add-ins - in a
with Events Class
What I don't understand is why this code was being run when the Add-in
wasn't actively involved in the swapping between workbooks - i.e. I
wasn't swapping between a workbook and the Add-in - but between the
dictator and the empty book

Something in the Classes/Events model that I've missed obviously!

Thanks

Chris
 
It sounds like you're using an application event and it's just doing its job.
Looking for something at the application level and reacting to it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top