Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am creating a new workbook with a macro. I want the macro to be copied to
the new workbook too automatically so I can run that macro again from the new workbook. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Look at Chip Pearson's page on working with the VBE with code
http://www.cpearson.com/excel/vbe.htm -- Regards, Tom Ogilvy "Darshan" wrote in message ... I am creating a new workbook with a macro. I want the macro to be copied to the new workbook too automatically so I can run that macro again from the new workbook. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here how I do it with one of my projects.
With Workbooks("PERSONAL.XLS").VBProject ..VBComponents("FollowUpSupport").Export ("h:\Macros\FollowUpSupport.bas") ..VBComponents("ProjectSupport").Export ("h:\Macros\ProjectSupport.bas") ..VBComponents("PSSupport").Export ("h:\Macros\PSSupport.bas") ..VBComponents("PSLogin").Export ("h:\Macros\PSLogin.frm") End With With neoBook ..VBProject.VBComponents.Import "h:\Macros\FollowUpSupport.bas" ..VBProject.VBComponents.Import "h:\Macros\ProjectSupport.bas" ..VBProject.VBComponents.Import "h:\Macros\PSSupport.bas" ..VBProject.VBComponents.Import "h:\Macros\PSLogin.frm" ..VBProject.References.AddFromFile "C:\WINDOWS\system32\vbscript.dll\3" ..VBProject.References.AddFromFile "C:\WINDOWS\system32\shdocvw.dll" ..SaveAs "H:\EXCEL\FollowUpList.xls", xlWorkbookNormal End With End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another option would be just to leave the code in its own workbook.
Then have that "macro workbook" open whenever you need to run the macro. (I've found that it's easier to make a change in one workbook, than to find all the workbooks and update all those.) Darshan wrote: I am creating a new workbook with a macro. I want the macro to be copied to the new workbook too automatically so I can run that macro again from the new workbook. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy 2007 created macro to run in 2003 | Excel Discussion (Misc queries) | |||
I want to copy rows with values 0 to another worksheet automatica | Excel Worksheet Functions | |||
Macro Created but Not Running in Workbook | Excel Worksheet Functions | |||
Macro run each time a new workbook created | Excel Discussion (Misc queries) | |||
Runtime error for macro that works in workbook created in | Excel Discussion (Misc queries) |