ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as question. (https://www.excelbanter.com/excel-programming/432002-save-question.html)

Cerberus

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.

Atishoo

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.


JLGWhiz[_2_]

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.




JLGWhiz[_2_]

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.




Cerberus

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.





Arran

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.



All times are GMT +1. The time now is 12:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com