ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open file, then call macro... won't work (https://www.excelbanter.com/excel-programming/316356-open-file-then-call-macro-wont-work.html)

Kieran1028[_8_]

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

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

--
Kieran102
-----------------------------------------------------------------------
Kieran1028's Profile: http://www.excelforum.com/member.php...fo&userid=1567
View this thread: http://www.excelforum.com/showthread.php?threadid=27709


Tom Ogilvy

open file, then call macro... won't work
 
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.

--
Regards,
Tom Ogilvy

"Kieran1028" wrote in message
...

The following code won't work right:

Sub openthenrun()
Workbooks.Open
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 will
not continue on to run the "IMPORT" macro.

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

Any hints? Thanks...
-Kieran


--
Kieran1028
------------------------------------------------------------------------
Kieran1028's Profile:

http://www.excelforum.com/member.php...o&userid=15678
View this thread: http://www.excelforum.com/showthread...hreadid=277098




Pvanderploeg

open file, then call macro... won't work
 
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" wrote:

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.

--
Regards,
Tom Ogilvy

"Kieran1028" wrote in message
...

The following code won't work right:

Sub openthenrun()
Workbooks.Open
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 will
not continue on to run the "IMPORT" macro.

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

Any hints? Thanks...
-Kieran


--
Kieran1028
------------------------------------------------------------------------
Kieran1028's Profile:

http://www.excelforum.com/member.php...o&userid=15678
View this thread: http://www.excelforum.com/showthread...hreadid=277098





Tom Ogilvy

open file, then call macro... won't work
 
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.

--
Regards,
Tom Ogilvy

"Pvanderploeg" wrote in message
...
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" wrote:

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.

--
Regards,
Tom Ogilvy

"Kieran1028" wrote in message
...

The following code won't work right:

Sub openthenrun()
Workbooks.Open
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 will
not continue on to run the "IMPORT" macro.

I also tried placing the open filename line above into the code for

the
"IMPORT" macro, and the same thing happened.

Any hints? Thanks...
-Kieran


--
Kieran1028


------------------------------------------------------------------------
Kieran1028's Profile:

http://www.excelforum.com/member.php...o&userid=15678
View this thread:

http://www.excelforum.com/showthread...hreadid=277098








All times are GMT +1. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com