A
Andrew
Hi,
I am writing a macro to open a second workbook (call it B) and copy
the rows to the source workbook (call it A).
Here is the issue I am facing: The macro (in A) is not getting
control after executing the Workbooks.Open command, a code snippet is
shown below.
.....
sSourceFilePath = "C:\Created and Closed Lost.xls"
sSourceFileName = "Created and Closed Lost.xls"
.....
'open the source workbook
Workbooks.Open Filename:=sSourceFilePath, ReadOnly:=True
'Workbooks.Open (sSourceFilePath) 'this has been used and the same
problem occurs.
Windows(sSourceFileName).Activate
......
The macro finds and opens the 'Created and Closed Lost.xls' file [this
is B] correctly, but the macro [in A] never gets control back to
finish the rest of the script, continuing with the
Windows(sSourceFileName).Activate.
But the code works fine in the debugger.
I am using Office XP on MS XP OS with the latest patches.
All work is being done on a local drive in the same directory.
Any ideas?
Thanks very much for your help!
Andrew
I am writing a macro to open a second workbook (call it B) and copy
the rows to the source workbook (call it A).
Here is the issue I am facing: The macro (in A) is not getting
control after executing the Workbooks.Open command, a code snippet is
shown below.
.....
sSourceFilePath = "C:\Created and Closed Lost.xls"
sSourceFileName = "Created and Closed Lost.xls"
.....
'open the source workbook
Workbooks.Open Filename:=sSourceFilePath, ReadOnly:=True
'Workbooks.Open (sSourceFilePath) 'this has been used and the same
problem occurs.
Windows(sSourceFileName).Activate
......
The macro finds and opens the 'Created and Closed Lost.xls' file [this
is B] correctly, but the macro [in A] never gets control back to
finish the rest of the script, continuing with the
Windows(sSourceFileName).Activate.
But the code works fine in the debugger.
I am using Office XP on MS XP OS with the latest patches.
All work is being done on a local drive in the same directory.
Any ideas?
Thanks very much for your help!
Andrew