Forum Discussion
nserrano111
Apr 26, 2023Copper Contributor
Run-Time error "1004"
Hello,
I hope I am able to explain this as best as I can. I am going through a tutorial to automatically create and save invoices. However, I am getting stuck on the part where it actually saves the active worksheet through the path
Code that needs debugging v
.SaveAs Filename = path & fname, Filename = 51
Now originally the problem was that I was removing my name off the file address in path= "C:...."
since I do want to be shared into sharepoint files and I want all who have access to view, use and open if need be. Not sure if that would make a difference and if it does how do you suggest I write the file address? Either way I left it in because it was saying the path didn't exist or there was already something named like that...
Now its telling me
Method "saveas" of workbook_ failed and I don't know how to fix it.
I would greatly appreciate the help.
It should be
.SaveAs Filename:=path & fname, FileFormat:=51
i,e. with := instead of =, and with FileFormat as second argument, not Filename again.
- nserrano111Copper Contributorokay, now it is saying that 51 is already specified... do I just keep it as .SaveAs Filename:=path & fname ?
It's worth a try!