Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Dueling events

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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Dueling events

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.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"XP" wrote:

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...

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
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
New to Events Jim May Excel Programming 2 April 10th 06 05:44 AM
Dueling programs quartz[_2_] Excel Programming 1 September 21st 05 01:38 AM
events? [email protected] Excel Discussion (Misc queries) 1 September 14th 05 03:26 PM
Need some events... Tim Mattingly Excel Programming 0 August 16th 04 09:53 AM


All times are GMT +1. The time now is 02:10 PM.

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

About Us

"It's about Microsoft Excel"