VBA Code:
Filename_3 = Left(Filename_1, Len(Filename_1) - 10) & " UPLOAD VERSION.xlsx"
ActiveWorkbook.SaveCopyAs Filename:=Filename_3
above is a piece of code from a .xlsb file. when i save as xlsx the file is corrupted and cannot be opened.
saving as xls works but i need to make it xlsx
in another workbook i have this code and it works .
Any ideas ?
VBA Code:
Dim relativePath As String
Dim pathLength As Long
Dim pathEdit As String
Dim FinalPath As String
relativePath = ActiveWorkbook.FullName
pathLength = Len(relativePath)
pathEdit = Left(relativePath, pathLength - 5)
' MsgBox pathEdit
FinalPath = pathEdit & " " & SelectedView & " " & Format(Now, "yyyy-mm-dd hh-mm") & ".xlsx"
'MsgBox FinalPath
ActiveWorkbook.SaveAs Filename:=FinalPath
Last edited: