Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sharing workbooks | Excel Discussion (Misc queries) | |||
Sharing workbooks | Excel Discussion (Misc queries) | |||
macro: copy multiple workbooks to multiple tabs in single book | Excel Programming | |||
Changing source on multiple workbooks | Links and Linking in Excel | |||
Sharing workbooks | Excel Programming |