Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am posting this question for a co-worker but know enough of the problem to
be able to reply. Thanks for any help on this matter. We have an Excel plugin (MyPlugin.xla) in the XLStart folder. We need to run a public subroutine called MySub that is stored in the MyModule module from a VB6 program. We tried the following: Xapp.Application.Run "'MyPlugin.xla'!MyModule.MySub" This results in the following error message: Runtime error '1004': The macro 'MyPlugin.xla!MyModule.MySub' cannot be found. We've tried several combinations of syntax above with the following statements with similar results: Excel.AddIns.Add FileName:="C:\Program Files\Microsoft Office\OFFICE11\XLStart\MyPlugin.xla" AddIns("MyPlugin.xla").Installed = True and Xapp.Workbooks.Open FileName:="C:\Program Files\Microsoft Office\OFFICE11\XLStart\MyPlugin.xla" What is the correct way to run this macro? Thanks, David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are correct, the addin has to be loaded (and it isn't by default if
Excel is opened through automation). Then you would use the Run command you show. -- Regards, Tom Ogilvy "C. Johnson" wrote in message ... I am posting this question for a co-worker but know enough of the problem to be able to reply. Thanks for any help on this matter. We have an Excel plugin (MyPlugin.xla) in the XLStart folder. We need to run a public subroutine called MySub that is stored in the MyModule module from a VB6 program. We tried the following: Xapp.Application.Run "'MyPlugin.xla'!MyModule.MySub" This results in the following error message: Runtime error '1004': The macro 'MyPlugin.xla!MyModule.MySub' cannot be found. We've tried several combinations of syntax above with the following statements with similar results: Excel.AddIns.Add FileName:="C:\Program Files\Microsoft Office\OFFICE11\XLStart\MyPlugin.xla" AddIns("MyPlugin.xla").Installed = True and Xapp.Workbooks.Open FileName:="C:\Program Files\Microsoft Office\OFFICE11\XLStart\MyPlugin.xla" What is the correct way to run this macro? Thanks, David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with calling .dll from excel VBA | Excel Programming | |||
calling excel macro | Excel Programming | |||
Calling Excel Macro From Vc++ via DDE | Excel Programming | |||
calling a dll from excel macro | Excel Programming | |||
problem with selection when calling macro externally from VB6 | Excel Programming |