PC Review


Reply
Thread Tools Rate Thread

assign macro to active workbook??

 
 
=?Utf-8?B?S2V2aW4=?=
Guest
Posts: n/a
 
      18th Oct 2007
I have 6 instances of a spreadhseet for different sites. they all have the
same toolbars created and every time you open one it imports the toolbars and
every time you close one it deletes the toolbars. This works good if you
only have one sheet open at a time, but if you have 2 open at the same time
the first one open has the toolbar that refers to that workbook. if you
close thefirst sheet the toolbar stays and the buttons refer to the now
closed wrkbook and if you click one of the buttons it reopends that work book.

Is there a way to have the macros assigned to the buttons as activeworkbook,
instead of the workbook name?
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      18th Oct 2007
How about an alternative suggestion.

Remove all the code from each of these workbooks.

Create a new workbook with all this code and save it as an addin. Tell the
users to open this addin each time they need to use one of those macros.

By having only one workbook/addin with the code, it should be easier to update
when things change, too.

Kevin wrote:
>
> I have 6 instances of a spreadhseet for different sites. they all have the
> same toolbars created and every time you open one it imports the toolbars and
> every time you close one it deletes the toolbars. This works good if you
> only have one sheet open at a time, but if you have 2 open at the same time
> the first one open has the toolbar that refers to that workbook. if you
> close thefirst sheet the toolbar stays and the buttons refer to the now
> closed wrkbook and if you click one of the buttons it reopends that work book.
>
> Is there a way to have the macros assigned to the buttons as activeworkbook,
> instead of the workbook name?


--

Dave Peterson
 
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
Re: Call macro from active workbook JLGWhiz Microsoft Excel Programming 0 3rd Oct 2009 02:42 AM
Run Macro on all WS in active workbook.. jeremiah Microsoft Excel Programming 6 6th May 2008 05:56 PM
Assign macro name to menu command w/o using workbook name =?Utf-8?B?QmxpZ2h0X1BldGU=?= Microsoft Excel Misc 0 3rd Aug 2006 10:48 PM
Macro to assign a printer to a workbook Gordon Forbes Microsoft Excel Programming 6 25th Feb 2004 10:00 AM
run a macro on an in-active workbook jfeka Microsoft Excel Programming 4 19th Jul 2003 03:49 PM


Features
 

Advertising
 

Newsgroups
 


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