PC Review


Reply
Thread Tools Rate Thread

2003 toolbars problem

 
 
Michelle
Guest
Posts: n/a
 
      10th May 2010
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

 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      10th May 2010
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Excel 2003 toolbars in Excel 2007 Eric Falzon Microsoft Excel Programming 2 14th Feb 2007 06:23 PM
Outlook 2003 Toolbars =?Utf-8?B?UGF1bA==?= Microsoft Outlook Discussion 4 3rd Sep 2006 09:35 AM
Outlook 2003 Toolbars =?Utf-8?B?TWFydGlu?= Microsoft Outlook Discussion 2 24th May 2005 06:45 PM
Word 2003 Toolbars Kerry Microsoft Word Document Management 1 29th Mar 2005 02:35 PM
Toolbars 2003 john Microsoft Outlook Discussion 1 28th Feb 2005 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 PM.