alienscript
Registered User.
- Local time
- Today, 13:00
- Joined
- Jul 17, 2004
- Messages
- 20
Hi the experts,
I was creating a Macro and face this SaveAs problem.. I illustrate with example below.
1) I already have a standard Excel file in C:\ as "Template.xls"
2) I recorded a macro on my excel "Template.xls" and copy-paste all the formulas as values and saved it as filename "Status (reviewed).xls"
3) I then re-type all the formulas in the active worksheet "Status (reviewed).xls" and saved it back in C:\ as "Template.xls"
4) then I stopped the macro recording.
5) I used Private Sub Workbook_Open() function in VB "ThisWorkbook"to auto-start the above macro in "Template.xls".
6) The macro auto-load works but before it could complete End Sub, it prompts me something like this: '"A file named 'C:\foldername\filename.xls' already exists in this location. Do you want to replace it ? It asks with three buttons -YES/NO/Cancel". The default button is at NO.
I had to click YES twice for the 2 SaveAs in order to continue the macro action. What should I add/change in the code to automatically continue by allowing YES ?
I attached the sample file. Please help me.
Thanks a lot in advance.
I was creating a Macro and face this SaveAs problem.. I illustrate with example below.
1) I already have a standard Excel file in C:\ as "Template.xls"
2) I recorded a macro on my excel "Template.xls" and copy-paste all the formulas as values and saved it as filename "Status (reviewed).xls"
3) I then re-type all the formulas in the active worksheet "Status (reviewed).xls" and saved it back in C:\ as "Template.xls"
4) then I stopped the macro recording.
5) I used Private Sub Workbook_Open() function in VB "ThisWorkbook"to auto-start the above macro in "Template.xls".
6) The macro auto-load works but before it could complete End Sub, it prompts me something like this: '"A file named 'C:\foldername\filename.xls' already exists in this location. Do you want to replace it ? It asks with three buttons -YES/NO/Cancel". The default button is at NO.
I had to click YES twice for the 2 SaveAs in order to continue the macro action. What should I add/change in the code to automatically continue by allowing YES ?
I attached the sample file. Please help me.
Thanks a lot in advance.