![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: New Zealand
Posts: 24
|
I need to rename a workbook without saving it. Is there any way of doing this in VBA, or any other way?
Thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Quote:
ActiveWorkbook.SaveAs "MyFile.xls" Kill "MyPreviousFileName.xls" Hope this helps, Russell |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2011
Posts: 54
|
What can you do if the file you want to delete varies in names?
My file name will depend on what it was saved as originally, and this is pulled from a cell. |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2011
Posts: 54
|
this is what I have so far that isn't working, looking at what you provided and amending it with some information I got from elsewhere -
ActiveWorkbook.SaveAs "S:\aliclock\Department Forms\Delete\Sickness Forms Complete.xlsm" Kill "S:\aliclock\PAULINE SICKNESS TEST\" & Range("b11").Value Application.Quit It still is erroring, any ideas? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|