G
gims289
I have code that copies and existing tab into a new spreadsheet then saves
the new spreadsheet. There is code after that that will close the newly
formed spreadsheet and activate the previous spreadsheet. Problem is that
after the code to save the new spreadsheet runs, the code just stops
executing (doesn’t continue to close the new file). Furthermore, the new
spreadsheet doesn’t get save – even though the file name at the top shows
that it was saved. Any help would be appreciated.
'Make a copy of the letter
Sheets("Letter 1").Copy
Sheets("Letter 1").Name = GrpNumber
'Save the workbook – variables have been previously defined
ActiveWorkbook.SaveAs FileName:= _
"G:\Filepath.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Windows("Previous File.xls").Activate
Sheets("Letter 1").Select
the new spreadsheet. There is code after that that will close the newly
formed spreadsheet and activate the previous spreadsheet. Problem is that
after the code to save the new spreadsheet runs, the code just stops
executing (doesn’t continue to close the new file). Furthermore, the new
spreadsheet doesn’t get save – even though the file name at the top shows
that it was saved. Any help would be appreciated.
'Make a copy of the letter
Sheets("Letter 1").Copy
Sheets("Letter 1").Name = GrpNumber
'Save the workbook – variables have been previously defined
ActiveWorkbook.SaveAs FileName:= _
"G:\Filepath.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Windows("Previous File.xls").Activate
Sheets("Letter 1").Select