Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save under same location

Status
Not open for further replies.

maximas

Programmer
Nov 29, 2002
40
US
i have a saveas macro and when the user click the macro to run it, it will save a new file with the name provided and put in the same location, but file always save under my documents in my computer.
ActiveWorkbook.SaveAs FileName:= _
finalname & ".xls", FileFormat:=xlNormal, _
password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
 
Just to let you know your post has been read, but unless I'm missing something, I see no problem/question here. The file location is set by the program defaults unless specified elsewhere.
 
Yep. Methinks Berton is right. Go to Tools, Options, General, and change the default file location if you want something other that My Documents as the target.
 
Assuming that what you mean is you want to save your active book again, under a different name but in the same location?

If you use save as you should be presented with the location of the open file but obviously there is something wrong in which case force the issue by using

Code:
saveas filename:= thisworkbook.path & "\" & finalname & ".xls"

or hardcode the path ie

Code:
saveas filename:= "\\servername\sharename\folder\" & finalname & ".xls"
or something like that!

;-) If a man says something and there are no women there to hear him, is he still wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top