+ Reply to Thread
Results 1 to 3 of 3

BeforeSave

  1. #1
    Steven
    Guest

    BeforeSave

    I have a file that is used by another person in their directory. When they
    save the file I do various tests on values of certain range named cells and
    if all the values are ok then that means the file is basically in good order
    and I want a copy. The issue is they sometimes mess up a file and don't
    realize it until they have mess it up even more, but it I can get a copy
    when all test conditions are ok then I will always have the last good copy
    handy. I was hoping to do somethin like this:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    If (Here are various tests and if OK) Then
    ActiveWorkbook.SaveAs Filename:="F:\Shared\Systems\Book3.xls",
    FileFormat:= xlNormal, Password:="mybackup"
    Endif

    End Sub
    And then it would go ahead and save their file in their directory.

    Note: I would alwasy like their file saved and only save to my directory if
    all the tests are ok. I have tried the above but excel errors totally out
    where you get the message. Do you want to send a report to Microsoft?

    Is there a way to do what I want?

    Thank you for your help.

    Steven

  2. #2
    Damon Longworth
    Guest

    Re: BeforeSave

    Have a look at the SaveCopyAs Method in help.

    --
    Damon Longworth

    2006 East Coast Excel User Conference
    April 19/21st, 2006
    Holiday Inn, Boardwalk
    Atlantic City, New Jersey
    Early Bird Registration Now Open!!
    www.ExcelUserConference.com

    2006 UK Excel User Conference
    Summer, 2006
    London, England



    "Steven" <[email protected]> wrote in message
    news:[email protected]...
    I have a file that is used by another person in their directory. When they
    save the file I do various tests on values of certain range named cells and
    if all the values are ok then that means the file is basically in good order
    and I want a copy. The issue is they sometimes mess up a file and don't
    realize it until they have mess it up even more, but it I can get a copy
    when all test conditions are ok then I will always have the last good copy
    handy. I was hoping to do somethin like this:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
    Boolean)

    If (Here are various tests and if OK) Then
    ActiveWorkbook.SaveAs Filename:="F:\Shared\Systems\Book3.xls",
    FileFormat:= xlNormal, Password:="mybackup"
    Endif

    End Sub
    And then it would go ahead and save their file in their directory.

    Note: I would alwasy like their file saved and only save to my directory if
    all the tests are ok. I have tried the above but excel errors totally out
    where you get the message. Do you want to send a report to Microsoft?

    Is there a way to do what I want?

    Thank you for your help.

    Steven



  3. #3
    Steven
    Guest

    Re: BeforeSave

    And its good.

    Thank you very much.


    "Damon Longworth" wrote:

    > Have a look at the SaveCopyAs Method in help.
    >
    > --
    > Damon Longworth
    >
    > 2006 East Coast Excel User Conference
    > April 19/21st, 2006
    > Holiday Inn, Boardwalk
    > Atlantic City, New Jersey
    > Early Bird Registration Now Open!!
    > www.ExcelUserConference.com
    >
    > 2006 UK Excel User Conference
    > Summer, 2006
    > London, England
    >
    >
    >
    > "Steven" <[email protected]> wrote in message
    > news:[email protected]...
    > I have a file that is used by another person in their directory. When they
    > save the file I do various tests on values of certain range named cells and
    > if all the values are ok then that means the file is basically in good order
    > and I want a copy. The issue is they sometimes mess up a file and don't
    > realize it until they have mess it up even more, but it I can get a copy
    > when all test conditions are ok then I will always have the last good copy
    > handy. I was hoping to do somethin like this:
    >
    > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
    > Boolean)
    >
    > If (Here are various tests and if OK) Then
    > ActiveWorkbook.SaveAs Filename:="F:\Shared\Systems\Book3.xls",
    > FileFormat:= xlNormal, Password:="mybackup"
    > Endif
    >
    > End Sub
    > And then it would go ahead and save their file in their directory.
    >
    > Note: I would alwasy like their file saved and only save to my directory if
    > all the tests are ok. I have tried the above but excel errors totally out
    > where you get the message. Do you want to send a report to Microsoft?
    >
    > Is there a way to do what I want?
    >
    > Thank you for your help.
    >
    > Steven
    >
    >
    >


+ 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