ExcelNoob222
Board Regular
- Joined
- Jun 17, 2020
- Messages
- 77
- Office Version
- 365
- Platform
- Windows
Hi all,
I have the below VBA code to save a file but I get a "Run-Time error '1004': Method 'SaveAs' of object '_workbook' failed.
It then highlights this row: ActiveWorkbook.SaveAs filename:=Path & filename & " Template.xlsx", FileFormat:=51
I cant seem to get this fixed. Any ideas?
I have the below VBA code to save a file but I get a "Run-Time error '1004': Method 'SaveAs' of object '_workbook' failed.
It then highlights this row: ActiveWorkbook.SaveAs filename:=Path & filename & " Template.xlsx", FileFormat:=51
VBA Code:
ET.Activate
Dim Path As String
Dim filename As String
Path = "C:\New"
filename = Range("C8")
ActiveWorkbook.SaveAs filename:=Path & filename & " Template.xlsx", FileFormat:=51
ActiveWorkbook.Close False
I cant seem to get this fixed. Any ideas?