Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Execute Macros from Other workbooks on current workbook
I'd like to be able to execute a macro I've got in A.XLS on the data in
B.XLS. I'm doing this from within a VB6 app. The code I've got seems to work great for simple executions of Macros within the same workbook, namely: workbookObject.Application.Run sMacroName, sarg1, sarg2 .... If sMacroName is something like "Sheet1.Macro2" all is well. However if I try something like sMacroName = "e:\temp\B.XLS!Sheet1.Macro2" I get one of several issues. First error I've seen while attempting in VB6 is: "The file cannot be opend because your virus scanner has detected a problem with the file". If instead I attempt this via VBA code within Excel itself like so: Run "e:\delme\tryme3.xls!ThisWorkbook.Hello" I get an error "The macro 'e:\delme\tryme3.xls!ThisWorkbook.Hello' cannot be found. I know within the VBA of Excel is at least gettting to the point where it opens the file, but for some reason it says it cannot find the macro. If I rename the file to something that does not exist and run the same line of code above, I get the same error as within the VB6 code, namely: "The file cannot be opend because your virus scanner has detected a problem with the file". Any help is greatly appreciated. Allen Segall (Softinterface, Inc.) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Execute Macros through Hyperlinks. | Excel Programming | |||
How to execute Macros through Text Links? | Excel Discussion (Misc queries) | |||
How to execute macros not saved in a workbook | Excel Programming | |||
Execute macros under Excel and Oulook XP | Excel Programming | |||
Execute macros under Excel and Oulook XP | Excel Programming |