Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Auto Add to WB saved Name

Have been trying for some time to determine how to add to a currently saved
workbook name. This is to indicate that the workbook in question has been
processed by the VB Programming.
I have used the following successfully, but so far have not been able to get
the extra added on the end of the name: eg: File name XYZ.XLS becomes
XYZ_Done.xls. I understand that I have to use the dot as a reference point,
since the actual workbook name could be any length (number of characters)
Any suggestions would be appreciated.

Dim OldName As String
Dim OldPath As String
Dim NewName As String

OldPath = ActiveWorkbook.Path & "\"
OldName = ActiveWorkbook.Name

NewName = "DONE_" + OldName

ActiveWorkbook.SaveAs NewName

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Auto Add to WB saved Name

Try this

NewName = OldPath & Left(OldName, Len(OldName) - 4) & "_DONE.xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"BEEJAY" wrote in message ...
Have been trying for some time to determine how to add to a currently saved
workbook name. This is to indicate that the workbook in question has been
processed by the VB Programming.
I have used the following successfully, but so far have not been able to get
the extra added on the end of the name: eg: File name XYZ.XLS becomes
XYZ_Done.xls. I understand that I have to use the dot as a reference point,
since the actual workbook name could be any length (number of characters)
Any suggestions would be appreciated.

Dim OldName As String
Dim OldPath As String
Dim NewName As String

OldPath = ActiveWorkbook.Path & "\"
OldName = ActiveWorkbook.Name

NewName = "DONE_" + OldName

ActiveWorkbook.SaveAs NewName



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Auto Add to WB saved Name

Works Great. Thanks so much


"Ron de Bruin" wrote:

Try this

NewName = OldPath & Left(OldName, Len(OldName) - 4) & "_DONE.xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"BEEJAY" wrote in message ...
Have been trying for some time to determine how to add to a currently saved
workbook name. This is to indicate that the workbook in question has been
processed by the VB Programming.
I have used the following successfully, but so far have not been able to get
the extra added on the end of the name: eg: File name XYZ.XLS becomes
XYZ_Done.xls. I understand that I have to use the dot as a reference point,
since the actual workbook name could be any length (number of characters)
Any suggestions would be appreciated.

Dim OldName As String
Dim OldPath As String
Dim NewName As String

OldPath = ActiveWorkbook.Path & "\"
OldName = ActiveWorkbook.Name

NewName = "DONE_" + OldName

ActiveWorkbook.SaveAs NewName




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
HOW DO I AUTO NAME A SAVED FILE FROM A SPEC. BLOCK IN EXCEL? bbrinker Excel Discussion (Misc queries) 8 December 16th 08 11:01 PM
How do I recover a file not saved - auto reboot? publishing in phoenix Excel Discussion (Misc queries) 0 June 13th 07 03:10 PM
How to get Excel to auto sum after it has been saved with data. Willow Oaks Excel Discussion (Misc queries) 1 October 5th 05 01:34 AM
Excel auto opens last saved file. Ducky Excel Discussion (Misc queries) 1 September 9th 05 07:20 PM
Auto-Insert "Last Saved By" Barb Reinhardt Excel Worksheet Functions 1 September 6th 05 01:16 PM


All times are GMT +1. The time now is 01:47 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"