I have created an EXCEL appliction:
And I realy want to rename the book to more than BOOK1VB Code:
Set ExcelApp = CreateObject("Excel.Application") 'ExcelApp.Visible = False Set ExcelBook = ExcelApp.workbooks.Add
Is it possible?
Printable View
I have created an EXCEL appliction:
And I realy want to rename the book to more than BOOK1VB Code:
Set ExcelApp = CreateObject("Excel.Application") 'ExcelApp.Visible = False Set ExcelBook = ExcelApp.workbooks.Add
Is it possible?
Do you want to rename it when you save?
the best way to rename a workbook is when you save it
VB Code:
ExcelBook.SaveAs Filename:="c:\WhatEverYouWant.xls"
I want it to have a name before saving. If it's possible, then name should be changed when the workbook has been created.
Thus, the end user will not have to wonder for a filename.
Create a template workbook named as you want and refer to it when you open it via code. It will append a 1 or whatever count of that workbook are open. Just like Word does with its Document1 etc.
Can I create the template in runtime without saving it?
Nope.
You can just create a blank new document and then save it to the disk as the filename you want and then reopen it for displaying to the user. Its about the only way as the .Name property of the document is read only.
:) 10X :thumb: