+ Reply to Thread
Results 1 to 8 of 8

name a backup file

  1. #1
    PR
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: name a backup file

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

    --
    Regards,
    Tom Ogilvy


    "PR" <paul.raeburn@ntlworld.com> wrote in message
    news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    > 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. #3
    PR
    Guest

    Re: 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" <twogilvy@msn.com> wrote in message
    news:OwBNBlK5FHA.3388@TK2MSFTNGP11.phx.gbl...
    > With ActiveWorkbook
    > .SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
    > format(date,"mmm") & ".xls"
    > End With
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "PR" <paul.raeburn@ntlworld.com> wrote in message
    > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    >> 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. #4
    Tom Ogilvy
    Guest

    Re: 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" <paul.raeburn@ntlworld.com> wrote in message
    news:eiOwErK5FHA.3788@TK2MSFTNGP10.phx.gbl...
    > 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" <twogilvy@msn.com> wrote in message
    > news:OwBNBlK5FHA.3388@TK2MSFTNGP11.phx.gbl...
    > > With ActiveWorkbook
    > > .SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
    > > format(date,"mmm") & ".xls"
    > > End With
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "PR" <paul.raeburn@ntlworld.com> wrote in message
    > > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    > >> 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. #5
    PR
    Guest

    Re: 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" <twogilvy@msn.com> wrote in message
    news:u4UECyK5FHA.3112@TK2MSFTNGP10.phx.gbl...
    > 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" <paul.raeburn@ntlworld.com> wrote in message
    > news:eiOwErK5FHA.3788@TK2MSFTNGP10.phx.gbl...
    >> 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" <twogilvy@msn.com> wrote in message
    >> news:OwBNBlK5FHA.3388@TK2MSFTNGP11.phx.gbl...
    >> > With ActiveWorkbook
    >> > .SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
    >> > format(date,"mmm") & ".xls"
    >> > End With
    >> >
    >> > --
    >> > Regards,
    >> > Tom Ogilvy
    >> >
    >> >
    >> > "PR" <paul.raeburn@ntlworld.com> wrote in message
    >> > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    >> >> 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. #6
    Tom Ogilvy
    Guest

    Re: 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" <paul.raeburn@ntlworld.com> wrote in message
    news:eKNFs7K5FHA.2816@tk2msftngp13.phx.gbl...
    > 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" <twogilvy@msn.com> wrote in message
    > news:u4UECyK5FHA.3112@TK2MSFTNGP10.phx.gbl...
    > > 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" <paul.raeburn@ntlworld.com> wrote in message
    > > news:eiOwErK5FHA.3788@TK2MSFTNGP10.phx.gbl...
    > >> 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" <twogilvy@msn.com> wrote in message
    > >> news:OwBNBlK5FHA.3388@TK2MSFTNGP11.phx.gbl...
    > >> > With ActiveWorkbook
    > >> > .SavecopyAs Left(.Fullname,len(.FullName)-4) & "_backup_" & _
    > >> > format(date,"mmm") & ".xls"
    > >> > End With
    > >> >
    > >> > --
    > >> > Regards,
    > >> > Tom Ogilvy
    > >> >
    > >> >
    > >> > "PR" <paul.raeburn@ntlworld.com> wrote in message
    > >> > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    > >> >> 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. #7
    Curt
    Guest

    Re: 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" <paul.raeburn@ntlworld.com> wrote in message
    > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    > > 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. #8
    Curt
    Guest

    Re: 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" <paul.raeburn@ntlworld.com> wrote in message
    > > news:uid8BdK5FHA.3976@TK2MSFTNGP15.phx.gbl...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1