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!

Saving a Spreadsheet as Different Name?

Status
Not open for further replies.

tescojez

Programmer
May 28, 2007
10
GB
Hi All,

Simple question (as always from me!). I don't know the syntax for saving an Excel Spreadsheet to a different name.

I use this code to open it:

Code:
    Set obj=CreateObject("Excel.Application")
    Set obj= getobject("D:\Scripts Output\" & SiteCode & " Aisle Layout MASTER.xls")
I then use loads of stuff to add Cell data, etc, etc

Now I need to save it with a different name ie not "MASTER" using a date.

The only code that works to save it is:

Code:
        Obj.save
        set objWorkBook = Nothing
        set objExcel = Nothing
But obviously that saves it as the same name. Also as "Hidden".

Help would be greatly appreciated.

Jez
 
Check out the SaveAs Method,

Obj.SaveAs Filename:= "Not Master"


[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top