Changing Workbook Name without Save As?

  • Thread starter Thread starter Don Wiss
  • Start date Start date
D

Don Wiss

I have a macro that loads up a read only workbook and populates it with
data. It now leaves it up to the user to do a save as. I'd like to change
the workbook name to one assembled from the user's data, but not actually
save it. The user needs to input more data first. Logically it would be:

ActiveWorkbook.Name = "NewName.xls"

But this doesn't work. Is doing this possible?

Thanks, Don <donwiss at panix.com>.
 
Don,

A workbook's name is the same as its file name, so you can't change the name
without doing a Save.
 
You could modify this to suit

Sub movefile()
OldName = "C:\yourfolder\1065.xls"
NewName = "C:\a\1065.xls"
Name OldName As NewName
End Sub
 
Back
Top