Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Worksheets and Events

I have a workbook that has multiple worksheets - all sharing the same code in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one of
the other sheets back to the first sheet.

Thanks

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Worksheets and Events

Do you want to share the event code? That is probably where the answer
lies.


"sarndt" wrote in message
...
I have a workbook that has multiple worksheets - all sharing the same code
in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move
back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I
go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the
first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I
control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one of
the other sheets back to the first sheet.

Thanks

Steve



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Worksheets and Events

If you mean between the worksheets, no I don't. Each worksheet should stand
independent of the rest.

Steve

--------

"sarndt" wrote:

I have a workbook that has multiple worksheets - all sharing the same code in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one of
the other sheets back to the first sheet.

Thanks

Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Worksheets and Events

Without viewing the code, any suggetion to correct the problem would be a
wild guess. The problem has to be in your code since Excel does not
generate events on its own. If you do not want to post the relevant code,
then you will probably not find much help on this site.



"sarndt" wrote in message
...
If you mean between the worksheets, no I don't. Each worksheet should
stand
independent of the rest.

Steve

--------

"sarndt" wrote:

I have a workbook that has multiple worksheets - all sharing the same
code in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move
back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I
go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the
first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I
control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one
of
the other sheets back to the first sheet.

Thanks

Steve



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Worksheets and Events

As a further comment, it appears from your description that the relevant
code would be in either the worksheet code module or the ThisWorkbook code
module and is either related to the Worksheet_Change or the
WorksheetSelection_Change events.



"sarndt" wrote in message
...
If you mean between the worksheets, no I don't. Each worksheet should
stand
independent of the rest.

Steve

--------

"sarndt" wrote:

I have a workbook that has multiple worksheets - all sharing the same
code in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move
back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I
go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the
first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I
control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one
of
the other sheets back to the first sheet.

Thanks

Steve





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Worksheets and Events

Thanks - Your suggestion of the problem being in ThisWorkbook or the
worksheet code module pointed me in the right direction and I resolved it! I
hadn't destroyed the collections variable in the ThisWorkbook event that was
being used in the sheet module to create the object events when the worksheet
was activated. When I set it to nothing before looping to re-create my
events, it resolved the problem.

Steve

"JLGWhiz" wrote:

As a further comment, it appears from your description that the relevant
code would be in either the worksheet code module or the ThisWorkbook code
module and is either related to the Worksheet_Change or the
WorksheetSelection_Change events.



"sarndt" wrote in message
...
If you mean between the worksheets, no I don't. Each worksheet should
stand
independent of the rest.

Steve

--------

"sarndt" wrote:

I have a workbook that has multiple worksheets - all sharing the same
code in
the workbook, worksheets, module, and class module.

When I process events on the first worksheet everthing works correctly.
When I move to the other worksheets, everything works fine. When I move
back
to the first worksheet again, the events repeat themselves multiple times
depending on the number of other worksheets I activated. For example, I
go
to the second worksheet and back to the first worksheet, the events run 2
times instead of 1 time. I go to the third worksheet and back to the
first
worksheet, the events run 3 times instead of 1 time.

Anyone have thoughts on why would occur and how I could stop it. I
control
EnableEvents religiously throughout the code to stop the duplication of
events. And it works for everything except when I'm switching from one
of
the other sheets back to the first sheet.

Thanks

Steve



.

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
Worksheets events Brad Excel Programming 1 April 1st 09 08:20 PM
how to compare times of events btwn worksheets daveg Excel Worksheet Functions 1 February 28th 09 07:35 PM
How do i create a set of worksheets indvidual events to a master qundiva Excel Discussion (Misc queries) 1 December 20th 07 06:01 PM
Any mouse events for Worksheets? InExcelHell Excel Programming 0 January 10th 05 11:17 PM
How to trap KeyDown Events For Worksheets ? Adrian[_7_] Excel Programming 1 August 3rd 04 11:00 AM


All times are GMT +1. The time now is 02:55 AM.

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"