using Application.Run

W

WhytheQ

if the xls file xxx is open and I try the following then Bob's your
Uncle the code runs fine:

Sub runMe()
Application.Run "xxx.xls!xxx"
End Sub

if the xls file is closed and I run the following:

Sub runMe()
Application.Run "'C:\Documents and Settings\xxx.xls!xxx"
End Sub

.....the target file xxx opens but it then errors out before running
the macro

Anbody know why this happens

Any help appreciated
JasonQ
 
D

Dave Peterson

The workbook has to be open.
if the xls file xxx is open and I try the following then Bob's your
Uncle the code runs fine:

Sub runMe()
Application.Run "xxx.xls!xxx"
End Sub

if the xls file is closed and I run the following:

Sub runMe()
Application.Run "'C:\Documents and Settings\xxx.xls!xxx"
End Sub

....the target file xxx opens but it then errors out before running
the macro

Anbody know why this happens

Any help appreciated
JasonQ
 

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