Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
Hi there ,
To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
try this way:
Sub TestWA() Workbooks.Add ActiveWorkbook.SaveAs "Test.xls" End Sub pls do rate "MarMo" wrote: Hi there , To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
Just save it with the required name.
NickHK "MarMo" wrote in message ... Hi there , To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
thanks guys ,
Thanks for the suggestions. I tried saving it ,and it works fine. But it's not what i'm looking for. What i'm asking is propably not possible. When Excel opens a new book it does not save the book in a normal way. It opens a book with the default name "Book1.xls". As i'm adding up to 6 new workbooks with VBA in an excel application , Excel opens Book1.xls to Book6.xls What i'd like to do is , when adding a new book to assign a name to the new opened book without saving it directly. It's probably a stupid idea , but i'd like to know if it's possible. Maybe i should save the workbooks to some folder and let the user decide what to do with it. Any other suggestions are welcome. MarMo "MarMo" wrote in message ... Hi there , To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
Hi MarMo,
You have to save it first!, but you can do that by a *.xlt or template file Or you only want to ActiveWindow caption look only by : ActiveWindow.caption = "Mybook" Thanks, Halim MarMo menuliskan: thanks guys , Thanks for the suggestions. I tried saving it ,and it works fine. But it's not what i'm looking for. What i'm asking is propably not possible. When Excel opens a new book it does not save the book in a normal way. It opens a book with the default name "Book1.xls". As i'm adding up to 6 new workbooks with VBA in an excel application , Excel opens Book1.xls to Book6.xls What i'd like to do is , when adding a new book to assign a name to the new opened book without saving it directly. It's probably a stupid idea , but i'd like to know if it's possible. Maybe i should save the workbooks to some folder and let the user decide what to do with it. Any other suggestions are welcome. MarMo "MarMo" wrote in message ... Hi there , To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add new workbook with new name
Halim ,
This is exactly what i was looking for. So i presume that whenever Excel opens a new book , it only changes the caption ? Thanks for this very much MarMo wrote in message oups.com... Hi MarMo, You have to save it first!, but you can do that by a *.xlt or template file Or you only want to ActiveWindow caption look only by : ActiveWindow.caption = "Mybook" Thanks, Halim MarMo menuliskan: thanks guys , Thanks for the suggestions. I tried saving it ,and it works fine. But it's not what i'm looking for. What i'm asking is propably not possible. When Excel opens a new book it does not save the book in a normal way. It opens a book with the default name "Book1.xls". As i'm adding up to 6 new workbooks with VBA in an excel application , Excel opens Book1.xls to Book6.xls What i'd like to do is , when adding a new book to assign a name to the new opened book without saving it directly. It's probably a stupid idea , but i'd like to know if it's possible. Maybe i should save the workbooks to some folder and let the user decide what to do with it. Any other suggestions are welcome. MarMo "MarMo" wrote in message ... Hi there , To add a new workbook with VBA the code is a follows : Workbooks.add This opens a new workbook with the default name book1.xls Is there a way to alter the name when adding a new workbook ? I'd like to add the name through my VBA code when adding a new book. Thanks for any replies MarMo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook | Excel Programming | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |