Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multiple toolbars Etc 2007 vs. 2003 | Excel Discussion (Misc queries) | |||
Excel 2003: Customizing Toolbars | Excel Discussion (Misc queries) | |||
Problem with Excel 2003 toolbars in Excel 2007 | Excel Programming | |||
Toolbars in Excel 2003 | Excel Discussion (Misc queries) |