ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening an Excel spreadsheet from within an Excel spreadsheet (https://www.excelbanter.com/excel-programming/416108-opening-excel-spreadsheet-within-excel-spreadsheet.html)

dhputnam

Opening an Excel spreadsheet from within an Excel spreadsheet
 
I am writing a macro in Excel 2003 that opens another Excel spreadsheet using
the following VB statement:

Set RELReport = Workbooks.Open(s_externalLink, 0, ReadOnly:=True)

RELReport is a workbook object, and s_externalLink contains the path and
file name of the spreadsheet to open. The spreadsheet opens OK, but then the
macro hangs and won't go to the next Visual Basic statement. If I put a
breakpoint on or just prior to this statement and step through the code in
the debugger, it works fine, but without using the debugger, it hangs every
time.

Can anyone tell me how to fix this problem? Thanks.

Dave Peterson

Opening an Excel spreadsheet from within an Excel spreadsheet
 
Just a guess...

How do you invoke the macro? Do you use a shortcut key (like: ctrl-shift-A).

If you do, try dropping the shift from the key combination.

dhputnam wrote:

I am writing a macro in Excel 2003 that opens another Excel spreadsheet using
the following VB statement:

Set RELReport = Workbooks.Open(s_externalLink, 0, ReadOnly:=True)

RELReport is a workbook object, and s_externalLink contains the path and
file name of the spreadsheet to open. The spreadsheet opens OK, but then the
macro hangs and won't go to the next Visual Basic statement. If I put a
breakpoint on or just prior to this statement and step through the code in
the debugger, it works fine, but without using the debugger, it hangs every
time.

Can anyone tell me how to fix this problem? Thanks.


--

Dave Peterson

dhputnam

Opening an Excel spreadsheet from within an Excel spreadsheet
 
Dave,

Thank you very much for your guess! I removed the shortcut key entirely and
the problem went away. I now invoke the macro from a command button.

Don

"Dave Peterson" wrote:

Just a guess...

How do you invoke the macro? Do you use a shortcut key (like: ctrl-shift-A).

If you do, try dropping the shift from the key combination.

dhputnam wrote:

I am writing a macro in Excel 2003 that opens another Excel spreadsheet using
the following VB statement:

Set RELReport = Workbooks.Open(s_externalLink, 0, ReadOnly:=True)

RELReport is a workbook object, and s_externalLink contains the path and
file name of the spreadsheet to open. The spreadsheet opens OK, but then the
macro hangs and won't go to the next Visual Basic statement. If I put a
breakpoint on or just prior to this statement and step through the code in
the debugger, it works fine, but without using the debugger, it hangs every
time.

Can anyone tell me how to fix this problem? Thanks.


--

Dave Peterson



All times are GMT +1. The time now is 07:43 PM.

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