Hello there 🙂
Today I write a short macro for you to introduce various metolody of saving your workbooks.
Nice thing is that in VBA we have ready-made numeric section dedicated for most fileformats
FileExtStr = “.xlsb”: FileFormatNum = 50
FileExtStr = “.xlsx”: FileFormatNum = 51
FileExtStr = “.xlsm”: FileFormatNum = 52
FileExtStr = “.csv”: FileFormatNum = 6
FileExtStr = “.txt”: FileFormatNum = -4158
FileExtStr = “.prn”: FileFormatNum = 36
Sub SaveAs1()
ActiveWorkbook.SaveAs Filename:="C:\Users\u\Desktop\Nana.xlsm", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
Sub SaveAs2()
ActiveWorkbook.SaveAs Filename:="C:\Users\u\Desktop\Nana.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Sub SaveAs3()
ActiveWorkbook.SaveAs Filename:="C:\Users\u\Desktop\Nana2.xlsm", _
FileFormat:=52, CreateBackup:=False
End Sub
Sub SaveAs4()
ActiveWorkbook.SaveAs Filename:="C:\Users\u\Desktop\Nana2.xlsm", _
FileFormat:=6, CreateBackup:=False
End Sub