ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA: Renaming a workbook (https://www.excelbanter.com/excel-programming/295602-excel-vba-renaming-workbook.html)

Lazer[_2_]

Excel VBA: Renaming a workbook
 
How does one rename a workbook that was just created?

Thanks,
Elieze

--
Message posted from http://www.ExcelForum.com


Vasant Nanavati

Excel VBA: Renaming a workbook
 
You can't. You have to save it with the desired name.

--

Vasant

"Lazer " wrote in message
...
How does one rename a workbook that was just created?

Thanks,
Eliezer


---
Message posted from http://www.ExcelForum.com/




Bob Phillips[_6_]

Excel VBA: Renaming a workbook
 
You could do a SaveAs with the new name, then Kill the old name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can't. You have to save it with the desired name.

--

Vasant

"Lazer " wrote in message
...
How does one rename a workbook that was just created?

Thanks,
Eliezer


---
Message posted from http://www.ExcelForum.com/






Vasant Nanavati

Excel VBA: Renaming a workbook
 
True, Bob. And there wouldn't even be an old name to kill if the workbook
was just created. I just thought the OP was asking for some way of renaming
the workbook in memory without saving it, similar to renaming a worksheet.

--

Vasant


"Bob Phillips" wrote in message
...
You could do a SaveAs with the new name, then Kill the old name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can't. You have to save it with the desired name.

--

Vasant

"Lazer " wrote in message
...
How does one rename a workbook that was just created?

Thanks,
Eliezer


---
Message posted from http://www.ExcelForum.com/








Lazer[_3_]

Excel VBA: Renaming a workbook
 
Yes, Vasant, that is exactly what I was asking: How to change
Workbook from "Book1" to "My Own Name for My Workbook".

Thanks,
Elieze

--
Message posted from http://www.ExcelForum.com


Vasant Nanavati

Excel VBA: Renaming a workbook
 
As I said, there is no efficient way of doing this. You would need to save
it under the new name at least once for the new name to "take".

--

Vasant


"Lazer " wrote in message
...
Yes, Vasant, that is exactly what I was asking: How to change a
Workbook from "Book1" to "My Own Name for My Workbook".

Thanks,
Eliezer


---
Message posted from http://www.ExcelForum.com/




Bob Phillips[_6_]

Excel VBA: Renaming a workbook
 
Hi Vasant,

I agree, just trying to be creative in providing a solution.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
True, Bob. And there wouldn't even be an old name to kill if the workbook
was just created. I just thought the OP was asking for some way of

renaming
the workbook in memory without saving it, similar to renaming a worksheet.

--

Vasant


"Bob Phillips" wrote in message
...
You could do a SaveAs with the new name, then Kill the old name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can't. You have to save it with the desired name.

--

Vasant

"Lazer " wrote in message
...
How does one rename a workbook that was just created?

Thanks,
Eliezer


---
Message posted from http://www.ExcelForum.com/











All times are GMT +1. The time now is 10:42 AM.

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