DouglasWicker
New Member
- Joined
- Aug 8, 2017
- Messages
- 38
Morning all,
I have this code below written to save my spreadsheet
Dim Path As String
Dim filename As String
Path = "Private File Path"
filename = Range("Y2") + Range("Y1")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsm", FileFormat:=xlNormal
The issue I have is that the above code works fine to save an xls file but when I change it to xlsm, it seems to save fine but when I open it I get this error message?
Excel cannot open the file 'Filename.xlsm' because the file format or file extension is not valid. Verify that the file has not been corrupted and the file extension matches the format of the file.
It will open if I save it as an .xlsm file through excel's Save As function.
Any ideas?
I have this code below written to save my spreadsheet
Dim Path As String
Dim filename As String
Path = "Private File Path"
filename = Range("Y2") + Range("Y1")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsm", FileFormat:=xlNormal
The issue I have is that the above code works fine to save an xls file but when I change it to xlsm, it seems to save fine but when I open it I get this error message?
Excel cannot open the file 'Filename.xlsm' because the file format or file extension is not valid. Verify that the file has not been corrupted and the file extension matches the format of the file.
It will open if I save it as an .xlsm file through excel's Save As function.
Any ideas?