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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Save problems

Status
Not open for further replies.

dezian

Technical User
Jul 29, 2003
21
GB
I need to save a spread sheet to a specific directory using the value of a cell as the file name, the code below refering to the cell value to be used works, but the saved file is saved to the drive I am currently working in and not the directory path in the code below. Any help would be much aprieciated.


Sub savefile()

ActiveWorkbook.SaveAs FileName:="S:\WGSpecChemOps\QC Analytical\Facility 2\CERTS\2003\" & ActiveSheet.Range("I7").Value & ".xls"

End Sub

Cheer Andy
 
nothing wrong with the syntax - if you have more than 1 workbook open, however, it may be more advisable to use Thisworkbook.saveas etc etc etc

Rgds, Geoff
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
 
According to help file, if you don't include a full path, Microsoft Excel saves the file in the current folder. So, check the FileName:
Msgbox "S:\WGSpecChemOps\QC Analytical\Facility 2\CERTS\2003\" & ActiveSheet.Range("I7").Value & ".xls"

combo


 
do you have any "on error resume next" in your code previous to calling the save sub ??

Rgds, Geoff
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
 
Xlbo, I get no error message, the file just happily saves its self to the directory I'm working from.

Cheers Andy Hickson
 
Is S:\WGSpecChemOps... expected to be a mapped drive?
If so is it really mapped to S: ?

Just a guess.
 
I tried it and it worked just fine as long as the mapped drive and path exists
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top