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

I have a number of spreadsheets with customized menu bars across the top. In
each of these, I use Workbook_Open, _Activate, _Deactivate, and _BeforeClose
to ensure that the right custom menus end up on the right worksheets as I
move from on workbook to another.

The only problem I have is when I have multiple workbooks open and close
Excel, I seem to get caught in a loop. I need to run the _BeforeClose and I
need to have .EnableEvents=True the next time any of the files is opened.
How can I do this? Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Closing Excel and Events

Do you really need the Workbook_Open and the BeforeClose.

Regards,
Peter T

"ZipCurs" wrote in message
...
I have a number of spreadsheets with customized menu bars across the top.

In
each of these, I use Workbook_Open, _Activate, _Deactivate, and

_BeforeClose
to ensure that the right custom menus end up on the right worksheets as I
move from on workbook to another.

The only problem I have is when I have multiple workbooks open and close
Excel, I seem to get caught in a loop. I need to run the _BeforeClose and

I
need to have .EnableEvents=True the next time any of the files is opened.
How can I do this? Thanks in advance.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Closing Excel and Events

I am reading volumes into your succinct comment. I am assuming that you are
suggesting that getting rid of these will eliminate my problems. I would
have a harder time getting rid of _Open than _BeforeClose. I will try
getting rid of _BeforeClose, and putting it's limited functionallity into
_Deactivate. Let me know if I am totally misinterpretting this.

Thanks

"Peter T" wrote:

Do you really need the Workbook_Open and the BeforeClose.

Regards,
Peter T

"ZipCurs" wrote in message
...
I have a number of spreadsheets with customized menu bars across the top.

In
each of these, I use Workbook_Open, _Activate, _Deactivate, and

_BeforeClose
to ensure that the right custom menus end up on the right worksheets as I
move from on workbook to another.

The only problem I have is when I have multiple workbooks open and close
Excel, I seem to get caught in a loop. I need to run the _BeforeClose and

I
need to have .EnableEvents=True the next time any of the files is opened.
How can I do this? Thanks in advance.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Closing Excel and Events

Wow!!! That was easy. Thanks.

"Peter T" wrote:

Do you really need the Workbook_Open and the BeforeClose.

Regards,
Peter T

"ZipCurs" wrote in message
...
I have a number of spreadsheets with customized menu bars across the top.

In
each of these, I use Workbook_Open, _Activate, _Deactivate, and

_BeforeClose
to ensure that the right custom menus end up on the right worksheets as I
move from on workbook to another.

The only problem I have is when I have multiple workbooks open and close
Excel, I seem to get caught in a loop. I need to run the _BeforeClose and

I
need to have .EnableEvents=True the next time any of the files is opened.
How can I do this? Thanks in advance.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Closing Excel and Events

From your slightly later post it sounds like you've got it all sorted, but a
quick comment about my first post.

I didn't really intend you to 'read volumes into my succinct comment', but
for it to be taken at face value as a question, perhaps after a quick check
that all works fine without those events (sounds like it does, guess they
are 'attached' bars).

But you may well have come back with something like - yes, the open/close
events are needed to create and destroy the custom toolbars when the wb
opens/closes and the de-/activate to toggle visible as required. Had that
been the case I would have gone on to suggest a slight modification.

Anyway, glad the question probed the solution!

Regards,
Peter T


"ZipCurs" wrote in message
...
I am reading volumes into your succinct comment. I am assuming that you

are
suggesting that getting rid of these will eliminate my problems. I would
have a harder time getting rid of _Open than _BeforeClose. I will try
getting rid of _BeforeClose, and putting it's limited functionallity into
_Deactivate. Let me know if I am totally misinterpretting this.

Thanks

"Peter T" wrote:

Do you really need the Workbook_Open and the BeforeClose.

Regards,
Peter T

"ZipCurs" wrote in message
...
I have a number of spreadsheets with customized menu bars across the

top.
In
each of these, I use Workbook_Open, _Activate, _Deactivate, and

_BeforeClose
to ensure that the right custom menus end up on the right worksheets

as I
move from on workbook to another.

The only problem I have is when I have multiple workbooks open and

close
Excel, I seem to get caught in a loop. I need to run the _BeforeClose

and
I
need to have .EnableEvents=True the next time any of the files is

opened.
How can I do this? Thanks in advance.







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
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
Closing VB triggers closing Excel Minilek Excel Programming 2 August 6th 04 05:17 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM
Predicting that Excel is closing using events Todd Webb Excel Programming 1 September 20th 03 02:50 AM


All times are GMT +1. The time now is 06:55 PM.

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"