ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Renaming a workbook without saving (https://www.excelbanter.com/excel-programming/362043-renaming-workbook-without-saving.html)

Matt

Renaming a workbook without saving
 
Hello Everyone

I'm trying to rename a workbook, so that I can select it later on in the
macro as I move between different workbooks. I do not want to save it though
as I do not want to keep the file and it will also take up time

I've tried a simple

ActiveWorkbook.Name = "Analysis Code Data"

But this won't work as I am trying to 'assign a read-only property'

Thanks in advance for any help



funkymonkUK[_169_]

Renaming a workbook without saving
 

could you explain your process abit more in detail.

do you have like a master workbook which open another workbook then you
want to shift from one to the other?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=544221


Norman Jones

Renaming a workbook without saving
 
Hi Matt,

A workbook can only be named as part of a save process.

Try, instead setting thw workbook to an object variable which you can
subsequently reference in your procedure, e.g.:

Dim WB As Workbook

Set WB = ActiveWorkbook


---
Regards,
Norman



"Matt" wrote in message
...
Hello Everyone

I'm trying to rename a workbook, so that I can select it later on in the
macro as I move between different workbooks. I do not want to save it
though
as I do not want to keep the file and it will also take up time

I've tried a simple

ActiveWorkbook.Name = "Analysis Code Data"

But this won't work as I am trying to 'assign a read-only property'

Thanks in advance for any help





Matt

Renaming a workbook without saving
 
Thanks Norman

That does exactly what I was after

Cheers

Matt


"Norman Jones" wrote:

Hi Matt,

A workbook can only be named as part of a save process.

Try, instead setting thw workbook to an object variable which you can
subsequently reference in your procedure, e.g.:

Dim WB As Workbook

Set WB = ActiveWorkbook


---
Regards,
Norman



"Matt" wrote in message
...
Hello Everyone

I'm trying to rename a workbook, so that I can select it later on in the
macro as I move between different workbooks. I do not want to save it
though
as I do not want to keep the file and it will also take up time

I've tried a simple

ActiveWorkbook.Name = "Analysis Code Data"

But this won't work as I am trying to 'assign a read-only property'

Thanks in advance for any help







All times are GMT +1. The time now is 05:29 PM.

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