Changing Workbook Name without Save As?

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>.
 
C

Chip Pearson

Don,

A workbook's name is the same as its file name, so you can't change the name
without doing a Save.
 
D

Don Guillett

You could modify this to suit

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top