I'm trying to save a file created via VBA with Sheet(1) active.
(I ordered them the way I wanted them earlier in the code.)
The previous lines of code have added a sheet, named it, and put it in the last position. By default this new sheet is "active".
Consequently I must activate the sheet in Position 1 prior to saving
Depending on the Options the user selects the Sheet in Position 1 might be A or B. (both sheets are not created, only "A" or "B")
When it's A the code runs fine, when it's B I get an error.
The sheet is NOT hidden.
I have deleted all shapes from the new workbook.
I have deleted all code from the new workbook.
I have not yet saved the new workbook.
The error is:
Runtime error '-247417848 (800 10 108)':
Method "activate' of object'_Worksheet' failed.
Codes I've tried:
Activeworkbook.Sheets(1).Activate
Sheets(1).Activate
A.Activate
Fwb.A.Activate
(Fwb is the variable for the new workbook & A or B are the variable for the sheet name previously moved into Position 1.)
I've tried adding DoEvents just prior with no success.
Bookmarks