Changing the default name of added workbooks

prajul89

Active Member
Joined
Jul 9, 2011
Messages
404
Hi,
I am creating a report in a completely new book by Workbooks.Add method and not saving it so that I can change its name while saving.
The default name of the books are "Book?" which I want to change to "Trial Balance".
Is it possible to do so??:confused:
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Maybe
Code:
Set NewBook = Workbooks.Add
With NewBook
        .SaveAs Filename:=MyPath & "\" & "Trial Balance.xls"
End With

HTH
Colin
 
Upvote 0
I don't want to save the file, I want user to save the file.
I just want to change the default name of the Workbook
 
Upvote 0
ActiveWorkbook.Name = "test.xlsx"
Even this can't be accepted as activeworkbook is a read only file.
Any suggestions please.....
 
Upvote 0
The only way to change the name is to save it, or base it on a template with the name you want (though you will still get a numeric suffix)
 
Upvote 0
Create a workbook, save it as a template with whatever name you want. Then pass the full path of the template to your workbooks.add method
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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