assigning a workbook name

patl

Board Regular
Joined
Dec 15, 2005
Messages
123
is there a way to create a new workbook and assign it a name without saving it? I am trying to do this in a macro. Any advice is greatly appreciated
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
well, I would like to change the name of the new activeworkbook that was created as well. (from "sheet2" to something else). Is that possible?
 
Upvote 0
patl said:
well, I would like to change the name of the new activeworkbook that was created as well. (from "sheet2" to something else). Is that possible?

Change the name of the workbook or worksheet? :unsure: If you're looking to change the name of the worksheet, use something like
Code:
ActiveSheet.Name = "Whatever"

Note - assumes the sheet that's active is the sheet you want to re-name.
 
Upvote 0
change the name of the workbook. sorry i mean to say change from "book2" to something else.
 
Upvote 0
The "Name" property for the "Workbook" object is read-only. There may be a work-around using the VBA extensibility library. Why do yo need to change it? If you created the workbook via code, you should already have a reference to it...
 
Upvote 0
well ultimately the user wont see the code so it is more of a clarity thing. So when the report spits out 3 new workbooks, they have descriptive names. But its not too big a deal. i can work around it. thanks.
 
Upvote 0

Forum statistics

Threads
1,214,846
Messages
6,121,905
Members
449,054
Latest member
luca142

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top