I was tasked with debugging code and stummbled across this error message
"Method 'Save' of object '_Workbook' failed"
Here's the portion of the code that pertains to this...
Set TestBook = Workbooks.Open(XlsPath & strXlsFileName)
Set TestSheet = TestBook.Worksheets(1)
' Delete First Row in the XLS
Cells(1, 1).EntireRow.Delete
' Last 2 columns in XLS
For k = 1 To 2
Cells(1, 3).EntireColumn.Delete
Next k
finalrow = TestSheet.Range("A65000").End(xlUp).Row
For i = 1 To finalrow
TestSheet.Cells(i, 3) = UFirstthree
Next i
TestBook.Application.DisplayAlerts = False
TestBook.Save
TestBook.Application.Quit
strXlsFileName = Dir()
Loop
MsgBox "Data processing successful."
"Method 'Save' of object '_Workbook' failed"
Here's the portion of the code that pertains to this...
Set TestBook = Workbooks.Open(XlsPath & strXlsFileName)
Set TestSheet = TestBook.Worksheets(1)
' Delete First Row in the XLS
Cells(1, 1).EntireRow.Delete
' Last 2 columns in XLS
For k = 1 To 2
Cells(1, 3).EntireColumn.Delete
Next k
finalrow = TestSheet.Range("A65000").End(xlUp).Row
For i = 1 To finalrow
TestSheet.Cells(i, 3) = UFirstthree
Next i
TestBook.Application.DisplayAlerts = False
TestBook.Save
TestBook.Application.Quit
strXlsFileName = Dir()
Loop
MsgBox "Data processing successful."