Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have a macro i created that emails worksheets, it needs to be used on
different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How did you create the macro?
If you use the VBA editor you can save the macro as part of a worksheet or in the xlb file so it will be there everytime you launch Excel. Inbar. "TommyBoy" wrote: i have a macro i created that emails worksheets, it needs to be used on different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i created the macro in one worksheet and then exported it to use it in
other files, because other excel apps will need to use, so i'm trying to do it at run time like this: (it says it can't find the macro) //this will add a reference to outlook excelWorkbook.VBProject.References.AddFromFile(@"C :\Program Files\Microsoft Outlook\OFFICE11\msoutl.olb"); //this imports the macro to my file excelWorkbook.VBProject.VBComponents.Import(@"C:\T emp\ActiveSheet.bas"); //this runs it excelApp.GetType().InvokeMember("Run",System.Refle ction.BindingFlags.Default | System.Reflection.BindingFlags.InvokeMethod,null, excelApp,new Object[]{"'" + emFile.Name.ToString().Trim() + "'!SendActiveSheet.SendActiveSheet"}); Inbar wrote: How did you create the macro? If you use the VBA editor you can save the macro as part of a worksheet or in the xlb file so it will be there everytime you launch Excel. Inbar. "TommyBoy" wrote: i have a macro i created that emails worksheets, it needs to be used on different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do i save it to the xlb file?
Inbar wrote: How did you create the macro? If you use the VBA editor you can save the macro as part of a worksheet or in the xlb file so it will be there everytime you launch Excel. Inbar. "TommyBoy" wrote: i have a macro i created that emails worksheets, it needs to be used on different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You don't save macros to xlb files. Inbar is mistaken. xlb files hold
menu modifications. -- Regards, Tom Ogilvy "TommyBoy" wrote in message ... how do i save it to the xlb file? Inbar wrote: How did you create the macro? If you use the VBA editor you can save the macro as part of a worksheet or in the xlb file so it will be there everytime you launch Excel. Inbar. "TommyBoy" wrote: i have a macro i created that emails worksheets, it needs to be used on different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You open the xlb from excel, go to VBA, import the code, and save it back to
the xlb. "TommyBoy" wrote: how do i save it to the xlb file? Inbar wrote: How did you create the macro? If you use the VBA editor you can save the macro as part of a worksheet or in the xlb file so it will be there everytime you launch Excel. Inbar. "TommyBoy" wrote: i have a macro i created that emails worksheets, it needs to be used on different workbooks, but when i import it into a workbook at runtime it doesn't find it, do i have to save the vbproject first? or does anyone know what is going on? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO Problem | Excel Discussion (Misc queries) | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Macro Problem | Excel Worksheet Functions | |||
Macro problem | Excel Programming |