Hi, i have ritten some code t save an xlsm file as an xlsx file. It was working fine then all of a sudden started giving the error 'Run-time error '1004': Method 'SaveAs' of object'_Workbook' failed.
It does create and save the file in xlsx format but throws up the above message.
'Save as .xlsx format
Dim xlBook
Set xlBook = ActiveWorkbook
Application.DisplayAlerts = False
Application.EnableEvents = False
ChDir ActiveWorkbook.Path
ActiveWorkbook.SaveAs Filename:= _
Left(xlBook.Name, (InStrRev(xlBook.Name, ".", -1, vbTextCompare) - 1)) & ".xlsx", FileFormat:=51, CreateBackup:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
Any help would be greatly apreciated.
Bookmarks