ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Workbook Name without Save As? (https://www.excelbanter.com/excel-programming/277589-changing-workbook-name-without-save.html)

Don Wiss

Changing Workbook Name without Save As?
 
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.

Chip Pearson

Changing Workbook Name without Save As?
 
Don,

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


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"Don Wiss" wrote in message
...
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 Guillett[_4_]

Changing Workbook Name without Save As?
 
You could modify this to suit

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

"Don Wiss" wrote in message
...
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.





All times are GMT +1. The time now is 04:26 PM.

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