Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 2003 toolbars problem

I have a workbook that has a toolbar 'attached', plus some code on
BeforeClose and DeActivate which deletes/hides it.

It all works beautifully. Until...

I have a few versions of the workbook, for different purposes, and sometimes
I need to have 2 or even 3 of them open at once...

Suddenly it all goes a bit 'pear-shaped'. the toolbar now refers to the
macros in one of the books, but not necessarily the one that is active.
There are all kinds of problems such as:
Sometimes the toolbar is deleted by closing a book but there is still one of
the other books open - now with no toolbar
Sometimes clicking a button on the toolbar will cause a version of the file
that I had closed to open up again. And other associated problems.

Is there a standard way of handling this issue?
Or a clever solution that will ensure that the toolbar is always refering to
the acrtive book.

Thanks

M

  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default 2003 toolbars problem

It happens that Michelle formulated :
I have a workbook that has a toolbar 'attached', plus some code on
BeforeClose and DeActivate which deletes/hides it.

It all works beautifully. Until...

I have a few versions of the workbook, for different purposes, and sometimes
I need to have 2 or even 3 of them open at once...

Suddenly it all goes a bit 'pear-shaped'. the toolbar now refers to the
macros in one of the books, but not necessarily the one that is active.
There are all kinds of problems such as:
Sometimes the toolbar is deleted by closing a book but there is still one of
the other books open - now with no toolbar
Sometimes clicking a button on the toolbar will cause a version of the file
that I had closed to open up again. And other associated problems.

Is there a standard way of handling this issue?
Or a clever solution that will ensure that the toolbar is always refering to
the acrtive book.

Thanks

M


Sounds to me like a perfect scenario for making an addin that's
version-aware of the different workbooks, but has one toolbar which has
menus that work on any workbook belonging to the addin. This way you
can open workbooks that have no code or toolbars attached, but require
the addin to perform automated tasks. It's considerably more involved
than using a workbook with macros!

Alternatively, you could rename the existing toolbars to include the
version so there's no conflict. (e.g.: "MyProject1", "MyProject2"...)

Also, add this to the top of your code module:

Option Private Module

so that other toolbars attached to other version workbooks can't run
another version's macros.

HTH
Garry


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
multiple toolbars Etc 2007 vs. 2003 A Cherie Spies Excel Discussion (Misc queries) 0 August 28th 09 03:23 AM
Excel 2003: Customizing Toolbars brendotroy Excel Discussion (Misc queries) 2 September 18th 08 01:47 PM
Problem with Excel 2003 toolbars in Excel 2007 Eric Falzon Excel Programming 2 February 14th 07 06:23 PM
Toolbars in Excel 2003 Adam Excel Discussion (Misc queries) 3 November 3rd 05 02:54 PM


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