Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default name a backup file

I am trying to create a backup copy of a current spreadsheet, and I want to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default name a backup file

With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I want

to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default name a backup file

Tom,
thanks for this, how do I put into this part of the code:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls", FileFormat:= _
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I want

to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR






  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default name a backup file

change this:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls", FileFormat:= _
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True


to

'Silently overwrite any existing file with this name
Application.DisplayAlerts = False
With ActiveWorkbook
.SavecopyAs "D:\Last Months.xls"
End With
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
Tom,
thanks for this, how do I put into this part of the code:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls", FileFormat:=

_
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I

want
to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR








  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default name a backup file

Tom,
I have just realised that I cannot save it just by the month, so I wish to
save the date and time, I have tried to use this:
.SaveCopyAs Left(.FullName, Len(.FullName) - 4) & "_backup_" &
Format(Now, "dd Mmm yy h:mm") & ".xls"
but I get an error, can you please tell me why.

Paul

"Tom Ogilvy" wrote in message
...
change this:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls", FileFormat:= _
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True


to

'Silently overwrite any existing file with this name
Application.DisplayAlerts = False
With ActiveWorkbook
.SavecopyAs "D:\Last Months.xls"
End With
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
Tom,
thanks for this, how do I put into this part of the code:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls",
FileFormat:=

_
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I

want
to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR












  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default name a backup file

I tested it an the Colon is not allowed. If I change it to an underscore,
it works fine:

Sub ABC()
With ActiveWorkbook
sStr = Left(.FullName, Len(.FullName) - 4) & "_backup_" & _
Format(Now, "dd Mmm yy h_mm") & ".xls"

Debug.Print sStr
.SaveCopyAs sStr
End With

End Sub

C:\Data\AA_Sample_backup_08 Nov 05 17_05.xls

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
Tom,
I have just realised that I cannot save it just by the month, so I wish to
save the date and time, I have tried to use this:
.SaveCopyAs Left(.FullName, Len(.FullName) - 4) & "_backup_" &
Format(Now, "dd Mmm yy h:mm") & ".xls"
but I get an error, can you please tell me why.

Paul

"Tom Ogilvy" wrote in message
...
change this:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls", FileFormat:=

_
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True


to

'Silently overwrite any existing file with this name
Application.DisplayAlerts = False
With ActiveWorkbook
.SavecopyAs "D:\Last Months.xls"
End With
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
Tom,
thanks for this, how do I put into this part of the code:

ActiveWorkbook.SaveAs Filename:="D:\Last Months.xls",
FileFormat:=

_
xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=True

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I

want
to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR












  #7   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 469
Default name a backup file

This is close to my problem: Ask user to backup want to savecopyas. need to
return to active sheet to update for futheruse. When useing savefile as I
lose active sheet. Need to get location for and file name from user.Trying
to use input box for location and file name could be dialog box for save
copyas? useing xl2000
any Help greatly appreciated.
Thanks Curt

"Tom Ogilvy" wrote:

With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I want

to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR





  #8   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 469
Default name a backup file

All I need to is twek it a bit to get it
Thanks a bunch
Curt

"Curt" wrote:

This is close to my problem: Ask user to backup want to savecopyas. need to
return to active sheet to update for futheruse. When useing savefile as I
lose active sheet. Need to get location for and file name from user.Trying
to use input box for location and file name could be dialog box for save
copyas? useing xl2000
any Help greatly appreciated.
Thanks Curt

"Tom Ogilvy" wrote:

With ActiveWorkbook
.SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
format(date,"mmm") & ".xls"
End With

--
Regards,
Tom Ogilvy


"PR" wrote in message
...
I am trying to create a backup copy of a current spreadsheet, and I want

to
call it a backup copy and place the month in the title of the file.

Can anyone help me achieve this.

PR





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
Everytime i close an excel file, it creates a new backup file p Excel Discussion (Misc queries) 3 November 22nd 07 08:13 AM
backup file created jwelch176 Excel Discussion (Misc queries) 1 March 2nd 07 11:17 PM
how can open backup file Tufail Excel Discussion (Misc queries) 4 February 14th 07 09:39 PM
Backup file [email protected] Excel Discussion (Misc queries) 4 August 2nd 05 09:42 PM
backup file shital[_2_] Excel Programming 0 July 19th 03 07:33 PM


All times are GMT +1. The time now is 07:21 PM.

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

About Us

"It's about Microsoft Excel"