Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Application calling Excel File with Macro - Macros not working 1

Status
Not open for further replies.

mimpuerto

Programmer
Joined
Mar 19, 2003
Messages
5
Location
GB
Hi. I have an Excel application. This application is opening multiple Excel files. The Excel file contains macros. The macro opens another Excel file. When triggered by a VB application, the macro is executed except all methods issued. Thus, if i issue OPEN method, the macro will just run the line but not actually opening anything. But if i run in excel, it will execute the command.


Please help me find solution. Thanks a lot!
 
the workbook OPEN event will NOT fire if the workbook is opened via code

You need to call the macro from the code that opens the workbook

eg

pseudo code

workbboks("C:\A.xls").open
Application.Run("A.XLS!workbook_open" Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top