Bit of a head scratcher this one.
I have the following code
That created a save file, but it was corrupted when trying to open it. So searching on the internet led me to adding a FileFormat as I did here
But all I get now is "Compile Error - Named Argument not found"
I'm fairly certain it's a simple thing but i'm currently banging my head on the desk trying to figure out what's going on or how to save the file without it being corrupt.
I have the following code
VBA Code:
Sub SaveName()
Dim File_name As String
Dim Path As String
File_name = Range("AC13")
Path = "C:\Users\admin\Documents\Paint_Mixes\Two_Colour\"
ActiveWorkbook.SaveCopyAs Filename:=Path & File_name & ".xlsx"
MsgBox ("File is saved at " & Path & File_name)
With Range("C2")
.Value = .Value + 1
End With
End Sub
That created a save file, but it was corrupted when trying to open it. So searching on the internet led me to adding a FileFormat as I did here
VBA Code:
Sub SaveName()
Dim File_name As String
Dim Path As String
File_name = Range("AC13")
Path = "C:\Users\admin\Documents\Paint_Mixes\Two_Colour\"
ActiveWorkbook.SaveCopyAs Filename:=Path & File_name & ".xlsx", FileFormat:=xlOpenXMLWorkbook
MsgBox ("File is saved at " & Path & File_name)
With Range("C2")
.Value = .Value + 1
End With
End Sub
But all I get now is "Compile Error - Named Argument not found"
I'm fairly certain it's a simple thing but i'm currently banging my head on the desk trying to figure out what's going on or how to save the file without it being corrupt.