Dueling events

G

Guest

Using Office 2003 and Windows XP:

I've been slamming it pretty hard today and maybe I'm just tired, but I'm
having a conflict between events in a workbook and although I'm positive
there is an easy solution, I can't see it right now.

I have the following functions in my ThisWorkbook module:

Workbook_Open contains Function_1 and Function_2
Workbook_Activate contains Function_1 and Function_3

Workbook_Deactivate contains Function_4 and Function_5
Workbook_BeforeClose contains Function_4 and Function_6

How can I keep these functions from duplicating one another. When the user
opens the workbook, the above will fire function 1 twice, causing a problem.
When the user closes the file, function 4 will fire twice; yet when the user
switches between workbooks (or opens or closes the file), I need functions 1
and 4 to run once for their respective events...how can I accomplish this?

Thanks again for your help...
 
G

Guest

By what you write, it is firing on the open and the activate, and on close
and deactivate, why not just take the function out of the open and close?
Following what you wrote the activation and deactivation should take care of
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

Top