How do I call an excel macro from outside the workbook?

K

Kenji

I have an excel workbook that opens another excel workbook. I would like to
run a macro in the other workbook.. so far I have

public oexcel as new Excel.Application
oExcel.Workbooks.Open("newstuff.xls")

how can I run a macro within newstuff.xls?
Thanks!

Kenji
 
H

Harlan Grove

Kenji said:
I have an excel workbook that opens another excel workbook.
I would like to run a macro in the other workbook.. so far
I have

public oexcel as new Excel.Application
oExcel.Workbooks.Open("newstuff.xls")

how can I run a macro within newstuff.xls?

Application.Run "newstuff.xls!YourMacroNameHere"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top