I have an .xls with multiple worksheets. I have VB script attempting to save one of the worksheets to a new .xls file. When this is run, I get a "Run-time error '1004': Method 'SaveAs' of object '_Workbook' failed" error. My script outputs data to Sheet1. I can save Sheet1 to the new .xls file without problem. But if I add a new sheet, say, Sheet2, and try to save it to the new file, then I receive the above error. I do not receive this error if I save to a .csv or .txt file. The line that causes the error is as follows:
ActiveWorkbook.SaveAs FileName:=strFilename + ".xls",
FileFormat:=xlExcel4, CreateBackup:=False
Any thoughts would be appreciated.
Bookmarks