Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Evaluate Open Files / multiple instances open

I have a custom menu bar that gets activated when the file is open and gets
reset when the file is closed. Problem is the user is now telling me they
may have multiple instances of the same file open at one time.

I altered the Add code to reset before adding, so that only one set of the
menubar was open. This seems to work fine, problem is on the close event I
need to evaluate if multiple sheets (of this type) are open and then skip the
Reset (Application.CommandBars(1).Reset) on the close, if it is not the last
sheet of this kind open. Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Evaluate Open Files / multiple instances open

You could put an exception type If ... Then statement in like if the open
sheets are < 2 then do the reset command. That way if more than one sheet is
open it won't reset.

"Troubled User" wrote:

I have a custom menu bar that gets activated when the file is open and gets
reset when the file is closed. Problem is the user is now telling me they
may have multiple instances of the same file open at one time.

I altered the Add code to reset before adding, so that only one set of the
menubar was open. This seems to work fine, problem is on the close event I
need to evaluate if multiple sheets (of this type) are open and then skip the
Reset (Application.CommandBars(1).Reset) on the close, if it is not the last
sheet of this kind open. Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Evaluate Open Files / multiple instances open

Ok, I think I just found something else out. I am loading this in the Open
command When I add the menu item to the top, they point to the macros in
that file. Therefore, if I add menu item 1 in file 1 and it is visible in
file 2, when I try to run it in file 2 it is pointing at the macro in file 1.
I am going to change it so that the add code is in the Open event and the
activate event and run the reset in the beforeclose and deactivate. I think
I have got it working.



"Troubled User" wrote:

I have a custom menu bar that gets activated when the file is open and gets
reset when the file is closed. Problem is the user is now telling me they
may have multiple instances of the same file open at one time.

I altered the Add code to reset before adding, so that only one set of the
menubar was open. This seems to work fine, problem is on the close event I
need to evaluate if multiple sheets (of this type) are open and then skip the
Reset (Application.CommandBars(1).Reset) on the close, if it is not the last
sheet of this kind open. Any ideas?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Evaluate Open Files / multiple instances open

Not sure I follow the multiple instance problem.
You cannot open the same file in the same instance of Excel more than once.
If they have changed the filename, then technically it's not the same file.
However, if the menu bar is only applicable to that one file, use the
WB_Activate/Deactivate events to show/hide it.

NickHK

"Troubled User" wrote in message
...
I have a custom menu bar that gets activated when the file is open and

gets
reset when the file is closed. Problem is the user is now telling me they
may have multiple instances of the same file open at one time.

I altered the Add code to reset before adding, so that only one set of the
menubar was open. This seems to work fine, problem is on the close event

I
need to evaluate if multiple sheets (of this type) are open and then skip

the
Reset (Application.CommandBars(1).Reset) on the close, if it is not the

last
sheet of this kind open. Any ideas?



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
Open Excel 2007 files in new instances Iain Setting up and Configuration of Excel 1 December 3rd 09 10:24 AM
Repost: open multiple instances of Excel Dale Fye Excel Discussion (Misc queries) 2 August 13th 08 05:18 PM
Excel opens new instances when I text-open files Eric Excel Discussion (Misc queries) 0 November 15th 06 05:53 AM
to open multiple instances of excel slickS Excel Discussion (Misc queries) 0 August 21st 06 11:23 PM
open multiple files Dennis S. Excel Discussion (Misc queries) 1 April 28th 06 05:10 PM


All times are GMT +1. The time now is 05:43 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"