open file, then call macro... won't work

  • Thread starter Thread starter Kieran1028
  • Start date Start date
K

Kieran1028

The following code won't work right:

Sub openthenrun()
Workbooks.Ope
Filename:="C:\Kieran\Posturedata1\posturetemplate.xls"
Application.Run "PERSONAL.XLS!IMPORT"
End Sub

If I try to run this, it stops after opening the first file, and wil
not continue on to run the "IMPORT" macro.

I also tried placing the open filename line above into the code for th
"IMPORT" macro, and the same thing happened.

Any hints? Thanks...
-Kiera
 
Are you using a shortcut key to fire Openthenrun? If so, does the shortcut
include the shift key. If so, then use a shortcut key combination that does
not include the shift key.
 
I am having the same problem: VBA in Excel just quits with no error after
running workbooks.open. There is no shortcut key involved. Any ideas?

Tom Ogilvy said:
Are you using a shortcut key to fire Openthenrun? If so, does the shortcut
include the shift key. If so, then use a shortcut key combination that does
not include the shift key.
 
Do you have
On Error Resume Next

in your code. Perhaps it is hitting an error that causes it to quit.

This used to be a prevalent problem in xl97 when users had troublesome UDF's
in the worksheet.
 

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

Back
Top