willyboy58
Technical User
'In the Prop1Invoice folder I have the Prop1Invoice workbook that has three invoice sheets that are copied to the Propxfer workbook. But right before they are copied, a "File Not Found" dialog box appears with the Prop1Invoice folder and the "propxfer" filename. When I select Cancel, another File Not Found dialog box appears with the Prop1Invoice folder, but this time with the "propxfer.xls" filename (note the .xls).
When I select Cancel this time, my code continues to it proper completion. My code has both the Application.ScreenUpdating and DisplayAlerts set to False and then True at the end.
'By using the Stop statement I have _
'narrowed my problem down to the following bit of code.
Stop
Workbooks.Open Filename:="C:\MSOffice\Prop1Invoice\Prop1Invoice.xls", _
UpdateLinks:=3 'this opens Prop1Invoice so its Invoice _
sheets can be copied to the Propxfer workbook. _
'I have verified that the Propxfer workbook is already _
open at this time.
Workbooks("prop1invoice"
.Worksheets("InvoicePage3"
.Copy Before:=Workbooks("propxfer.xls"
.Sheets(1)
Workbooks("prop1invoice"
.Worksheets("InvoicePage2"
.Copy Before:=Workbooks("propxfer.xls"
.Sheets(1)
Workbooks("prop1invoice"
.Worksheets("InvoicePage1"
.Copy Before:=Workbooks("propxfer.xls"
.Sheets(1)
Stop
'Why is the File Not Found dialog box opening if the Prop1Invoice and Propxfer workbooks are already opened? Why is it looking for the "propxfer" file in the "Prop1Invoice" folder?
TIA
Bill
When I select Cancel this time, my code continues to it proper completion. My code has both the Application.ScreenUpdating and DisplayAlerts set to False and then True at the end.
'By using the Stop statement I have _
'narrowed my problem down to the following bit of code.
Stop
Workbooks.Open Filename:="C:\MSOffice\Prop1Invoice\Prop1Invoice.xls", _
UpdateLinks:=3 'this opens Prop1Invoice so its Invoice _
sheets can be copied to the Propxfer workbook. _
'I have verified that the Propxfer workbook is already _
open at this time.
Workbooks("prop1invoice"
Workbooks("prop1invoice"
Workbooks("prop1invoice"
Stop
'Why is the File Not Found dialog box opening if the Prop1Invoice and Propxfer workbooks are already opened? Why is it looking for the "propxfer" file in the "Prop1Invoice" folder?
TIA
Bill