Sub SaveAs(Filename As String, Format As String) 'XLS Format If UCase(Format) = "XLS" Then ActiveWorkbook.SaveAs Filename:= _ Filename, FileFormat:= _ xlExcel8, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False Else 'default 'XLSX Format ActiveWorkbook.SaveAs Filename:= _ Filename, FileFormat:= _ xlOpenXMLWorkbook, CreateBackup:=False End If End Sub Sub Test() SaveAs "C:\tmp\Filename.xls", "xlsx" SaveAs "C:\tmp\Filename.xlsx", "xls" End Sub
ERP Project Management,Asp.net,PL SQL Tips for error resolution,Research,Software Errors and solution,SQL 2014,2012,2008,Procedural language,SP,Power BI,excel macro ,Musical notations,Business software,Degree, diploma related informations.