Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Save as question.

Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory (s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any of
you have a better idea on how the save the file with unique document names.

Thanks for and help in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default Save as question.


SaveAs "C:\ssheets\" & Range("A1").Value
works fine for me so iguess yours would be
SaveAs "s:\Engineering\" & Range("insert cell address containing save name
here").Value
"Cerberus" wrote:

Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory (s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any of
you have a better idea on how the save the file with unique document names.

Thanks for and help in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Save as question.

fName = Sheets("CONFIG").Range("O220")
varDoc.ActiveDocument.SaveAs("s:\Engineering\" & fName)


"Cerberus" wrote in message
...
Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to
roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory
(s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any
of
you have a better idea on how the save the file with unique document
names.

Thanks for and help in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Save as question.

Works better:

fName = Sheets("CONFIG").Range("O220").Value
varDoc.ActiveDocument.SaveAs("s:\Engineering\" & fName)


"Cerberus" wrote in message
...
Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to
roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory
(s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any
of
you have a better idea on how the save the file with unique document
names.

Thanks for and help in advance.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Save as question.

Thank you guys. It works great!

"JLGWhiz" wrote:

Works better:

fName = Sheets("CONFIG").Range("O220").Value
varDoc.ActiveDocument.SaveAs("s:\Engineering\" & fName)


"Cerberus" wrote in message
...
Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to
roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory
(s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any
of
you have a better idea on how the save the file with unique document
names.

Thanks for and help in advance.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Save as question.

Cerberus,

Did you want the file path be locked or to give the user the functionality
of being able chose the locaction? is so then I have this code:

Sub saveme()

Application.EnableEvents = False

rtn = Application.Dialogs(xlDialogSaveAs).Show(arg1:=Thi sWorkbook.Sheets _
("Put your sheet name here").Range("Your cell ref").Value & ".xls")
If Not rtn Then Cancel = True
Cancel = True

Application.EnableEvents = True

End Sub

If you want to combine the values of more than 1 cell add this code after
..value and before & in the above code

& " " & Range("D7").Value

Hope this helps



"Cerberus" wrote:

Is there a way to save a file using a cell's information as the documents
name? I currently have it saving as a set name but now I'm wanting to roll
the project out but I need the documents name to be saved with a new name
everytime.

The code I have now is:

varDoc.ActiveDocument.SaveAs ("s:\Engineering\testWord.doc")

I would like to have the file saved in the same directory (s:\Engineering\)
but have the name reference Cell CONFIG!O220. Is that possible, or do any of
you have a better idea on how the save the file with unique document names.

Thanks for and help in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another Save Question Sandy Excel Worksheet Functions 1 May 19th 07 07:46 PM
Save & Save As Question Ray Batig Excel Programming 1 March 10th 06 03:16 AM
After Save - 1 more question Steph[_6_] Excel Programming 4 October 27th 05 08:17 PM
Another save as question FrigidDigit Excel Programming 1 May 23rd 05 08:56 PM
A save question: Phil Hageman Excel Programming 4 July 11th 03 05:11 PM


All times are GMT +1. The time now is 05:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"