|
-
Feb 28th, 2006, 12:16 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Renaming a Workbook
I have created an EXCEL appliction:
VB Code:
Set ExcelApp = CreateObject("Excel.Application")
'ExcelApp.Visible = False
Set ExcelBook = ExcelApp.workbooks.Add
And I realy want to rename the book to more than BOOK1
Is it possible?
I've had enough with sainity!
What's the use of it anyway?
-
Feb 28th, 2006, 12:43 PM
#2
Re: Renaming a Workbook
Do you want to rename it when you save?
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Feb 28th, 2006, 01:02 PM
#3
Addicted Member
Re: Renaming a Workbook
the best way to rename a workbook is when you save it
VB Code:
ExcelBook.SaveAs Filename:="c:\WhatEverYouWant.xls"
-
Feb 28th, 2006, 04:20 PM
#4
Thread Starter
Addicted Member
Re: Renaming a Workbook
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.
I've had enough with sainity!
What's the use of it anyway?
-
Feb 28th, 2006, 05:01 PM
#5
Re: Renaming a Workbook
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 1st, 2006, 05:43 PM
#6
Thread Starter
Addicted Member
Re: Renaming a Workbook
Can I create the template in runtime without saving it?
I've had enough with sainity!
What's the use of it anyway?
-
Mar 1st, 2006, 06:03 PM
#7
Re: Renaming a Workbook
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 4th, 2006, 05:18 PM
#8
Thread Starter
Addicted Member
Re: Renaming a Workbook
10X
I've had enough with sainity!
What's the use of it anyway?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|