B
Bob Myers
My spreadsheet (main.xls) has a number of macros. One of them (macro1)
tries to open another spreadsheet (file.xls). However, when file.xls opens,
the macro stops, rather than continuing with the rest of its code. I have
similar code in macro2, but it seems to work as expected.
An excerpt from macro1 code:
..
ChDir (ActiveWorkbook.Path) ' main.xls and file.xls are
in the same folder on C:
..
Workbooks.Open (file.xls) ' file.xls does not
include the path
x = 1
..
Running macro1, file.xls opens and macro1 stops. If the breakpoint is set
on the x = 1 line, execution never gets there.
If the Breakpoint is set on the Open line, execution halts there, but
pressing F8 (or F5) will cause macro1 to continue normally. Normally
includes executing similar code farther on in macro1.
Any suggestions? I've tried everything I can think of. FYI, I'm fairly new
to Excel, and particularly to VBA. I am experienced in several forms of
Basic, and a couple other high level languages.
Perhaps there's a workaround. All I really want to do is open file.xls,
copy a little bit of stuff into it, and then close it. I plan on doing this
to half a dozen files.xls.
Respectfully submitted,
Bob Myers
(e-mail address removed)
tries to open another spreadsheet (file.xls). However, when file.xls opens,
the macro stops, rather than continuing with the rest of its code. I have
similar code in macro2, but it seems to work as expected.
An excerpt from macro1 code:
..
ChDir (ActiveWorkbook.Path) ' main.xls and file.xls are
in the same folder on C:
..
Workbooks.Open (file.xls) ' file.xls does not
include the path
x = 1
..
Running macro1, file.xls opens and macro1 stops. If the breakpoint is set
on the x = 1 line, execution never gets there.
If the Breakpoint is set on the Open line, execution halts there, but
pressing F8 (or F5) will cause macro1 to continue normally. Normally
includes executing similar code farther on in macro1.
Any suggestions? I've tried everything I can think of. FYI, I'm fairly new
to Excel, and particularly to VBA. I am experienced in several forms of
Basic, and a couple other high level languages.
Perhaps there's a workaround. All I really want to do is open file.xls,
copy a little bit of stuff into it, and then close it. I plan on doing this
to half a dozen files.xls.
Respectfully submitted,
Bob Myers
(e-mail address removed)