I wrote a VBA procedure to repeatedly execute on workbooks (xls in compatibility mode), the name of which always starts with “Orig….” and ends with “….xls” .
The originals should be saved unchanged while the edited versions should be saved as .xlsm in the same folder as the originals but with “New” instead of “Orig” in the name.
So : OrigSomething.xls should be saved as NewSomething.xlsm
I tried this but the NewSomething comes out as expected but for the .xls format. I wonder what I’m doing wrong
Dim vers As Long, H As Integer, str1 As String
str1 = Replace(ActiveWorkbook.Name, "Orig", "New")
str1 = Replace(str1, xls, xlsm)
ActiveWorkbook.SaveAs Filename:=str1, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Thanks for any help
Herman
The originals should be saved unchanged while the edited versions should be saved as .xlsm in the same folder as the originals but with “New” instead of “Orig” in the name.
So : OrigSomething.xls should be saved as NewSomething.xlsm
I tried this but the NewSomething comes out as expected but for the .xls format. I wonder what I’m doing wrong
Dim vers As Long, H As Integer, str1 As String
str1 = Replace(ActiveWorkbook.Name, "Orig", "New")
str1 = Replace(str1, xls, xlsm)
ActiveWorkbook.SaveAs Filename:=str1, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Thanks for any help
Herman