Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Sharing and Changing a Macro in Multiple Workbooks

Greetings:

I have a macro that I want to use in multiple workbooks. If possible, I
want all the workbooks that need this macro to use the same module rather
copy the module separately to each workbook. That way, if the macro is
changed, all workbooks will get the change(s) automatically. Is this
possible?

Thanks in advance for your help.
--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Sharing and Changing a Macro in Multiple Workbooks

Create an add-in.
http://support.microsoft.com/default.aspx?kbid=211563
How to create an add-in file in Excel 2000


http://msdn.microsoft.com/library/de...ary/en-us/modc...
Building Application Specific Add-Ins


http://msdn.microsoft.com/library/de...ary/en-us/modc...
Excel Add-Ins


http://msdn.microsoft.com/library/de...ary/en-us/modc...
Add-ins, Templates, Wizards, and Libraries


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Barry" wrote in message
...
Greetings:

I have a macro that I want to use in multiple workbooks. If possible, I
want all the workbooks that need this macro to use the same module rather
copy the module separately to each workbook. That way, if the macro is
changed, all workbooks will get the change(s) automatically. Is this
possible?

Thanks in advance for your help.
--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Sharing and Changing a Macro in Multiple Workbooks

Barry,
You could create a custom button in the toolbar, then when each
workbook is open click the button to run the macro on that workbook,
but the main workbook will open, or has to be open already.
Or you could write a line in the macro that opens the other workbooks,
runs the macro, then closes the workbooks, like

This can be changed to whatever, this will run on workbook open

Private Sub Workbook_Open()

'open other workbook
Workbooks.Open "file path"

'run macro "test" in this workbook on the other workbook
Application.Run ("Test")

'close the other workbook
ActiveWorkbook.Close

End Sub

Hope this helps!
Andrew Armstrong

Barry wrote:
Greetings:

I have a macro that I want to use in multiple workbooks. If possible, I
want all the workbooks that need this macro to use the same module rather
copy the module separately to each workbook. That way, if the macro is
changed, all workbooks will get the change(s) automatically. Is this
possible?

Thanks in advance for your help.
--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sharing and Changing a Macro in Multiple Workbooks

You may want to consider creating a dedicated workbook with the code. Save that
workbook as an addin. And give the users an interface to run the macro.

(Write the code to work against the activesheet--so you don't rely on
sheetnames???).

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

Barry wrote:

Greetings:

I have a macro that I want to use in multiple workbooks. If possible, I
want all the workbooks that need this macro to use the same module rather
copy the module separately to each workbook. That way, if the macro is
changed, all workbooks will get the change(s) automatically. Is this
possible?

Thanks in advance for your help.
--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Sharing and Changing a Macro in Multiple Workbooks

Bob, Andrew & Dave

Thank you for your suggestions. I haven't had a chance to try them out yet.
I will post a response when I have done so.

--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.


"Dave Peterson" wrote:

You may want to consider creating a dedicated workbook with the code. Save that
workbook as an addin. And give the users an interface to run the macro.

(Write the code to work against the activesheet--so you don't rely on
sheetnames???).

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

Barry wrote:

Greetings:

I have a macro that I want to use in multiple workbooks. If possible, I
want all the workbooks that need this macro to use the same module rather
copy the module separately to each workbook. That way, if the macro is
changed, all workbooks will get the change(s) automatically. Is this
possible?

Thanks in advance for your help.
--
Barry Carroll

(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.


--

Dave Peterson



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
Sharing workbooks Smudge Excel Discussion (Misc queries) 1 December 1st 06 03:38 PM
Sharing workbooks Jo Davis Excel Discussion (Misc queries) 2 September 11th 06 03:54 PM
macro: copy multiple workbooks to multiple tabs in single book Michael Excel Programming 0 July 14th 06 04:53 PM
Changing source on multiple workbooks charlilot Links and Linking in Excel 1 January 26th 06 09:08 PM
Sharing workbooks Eric[_14_] Excel Programming 1 December 4th 03 07:54 PM


All times are GMT +1. The time now is 11:56 AM.

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"