Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Workbook renaming

I want to rename a workbook as soon as it’s loaded. In th
ThisWorkBook_Open event I tried:

Workbook.Name = “MyName.xls”

but that doesn’t work because WorkBook’s Name property is read-only.
then used a SaveAs routine using the new name. That works because th
workbook then assumes the name used in SaveAs, but saving the fil
takes too long. How can I rename a workbook while it’s loaded othe
than doing a “SaveAs”?

Any help greatly appreciated

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Workbook renaming

I think SaveAs is your only recourse: You can do a SaveAs, Then delete the old work book without letting the user know
Application.DisplayAlerts = Fals
Me.SaveAs "MyBook
Set FSO = CreateObject("Scripting.FileSystemObject"
FSO.DeleteFile ("OldBk.xls"
Application.DisplayAlerts = Tru

----- billyb wrote: ----

I want to rename a workbook as soon as its loaded. In th
ThisWorkBook_Open event I tried

Workbook.Name = €śMyName.xls€

but that doesnt work because WorkBooks Name property is read-only.
then used a SaveAs routine using the new name. That works because th
workbook then assumes the name used in SaveAs, but saving the fil
takes too long. How can I rename a workbook while its loaded othe
than doing a €śSaveAs€ť

Any help greatly appreciated


--
Message posted from http://www.ExcelForum.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Workbook renaming

You could try this.......

Application.DisplayAlerts = False
Me.SaveAs "NewName"
Kill "OldName.xls"
Application.DisplayAlerts = True

Cheers
Nigel

"billyb " wrote in message
...
I want to rename a workbook as soon as it's loaded. In the
ThisWorkBook_Open event I tried:

Workbook.Name = "MyName.xls"

but that doesn't work because WorkBook's Name property is read-only. I
then used a SaveAs routine using the new name. That works because the
workbook then assumes the name used in SaveAs, but saving the file
takes too long. How can I rename a workbook while it's loaded other
than doing a "SaveAs"?

Any help greatly appreciated!


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Workbook renaming

Many thanks for the reply, but I was hoping there was a workaround tha
would let me avoid SaveAs because it adds too much time to the proces
of opening the workbook. Guess I'm stuck with it though

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook renaming! aiyer[_21_] Excel Programming 1 May 12th 04 08:03 PM
Renaming workbook! aiyer[_20_] Excel Programming 1 May 11th 04 11:34 PM
Workbook crashes after renaming a worksheet - References problem? BenD[_2_] Excel Programming 0 April 21st 04 01:22 AM
Excel VBA: Renaming a workbook Lazer[_2_] Excel Programming 6 April 20th 04 08:56 AM
Renaming Sheets in a workbook Cameron MacRae Excel Programming 2 December 18th 03 11:19 PM


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"