Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Location
    Anderson, Indiana
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save file on close (Excel 2003)

    Ok .. it has been a very busy day, and I have been learning a lot of excel tricks today. Now... I would like to have a file automatcally save on close without prompting for a save. is this possibe?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save file on close (Excel 2003)

    Put the code below in the Workbook_BeforeClose event routine in the module behind the ThisWorkbook object:

    <pre>Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Workbook.Save
    End Sub
    </pre>

    Legare Coleman

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Location
    Anderson, Indiana
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save file on close (Excel 2003)

    I copied the code ... but when I close. i get an error:

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save file on close (Excel 2003)

    Sorry, that code should have been:

    <pre>Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.Save
    End Sub
    </pre>

    Legare Coleman

  5. #5
    New Lounger
    Join Date
    Mar 2002
    Location
    Anderson, Indiana
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save file on close (Excel 2003)

    That's It. Thanks.

Posting Permissions

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