Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workbook renaming! | Excel Programming | |||
Renaming workbook! | Excel Programming | |||
Workbook crashes after renaming a worksheet - References problem? | Excel Programming | |||
Excel VBA: Renaming a workbook | Excel Programming | |||
Renaming Sheets in a workbook | Excel Programming |