Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel VBA (Excel XP)

    What I want is to save and close an excel spreadsheet without being asked "Do you want to save changes?"

    This code ActiveWorkbook.Close SaveChanges: =xlsSaveChanges will run a save and close the open workbook. However, it still asks "Do you want to save changes? " which requires one more click before it closes. How can I get rid of "Do you want to save changes to book such and such?"

    Thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel VBA (Excel XP)

    Use
    ActiveWorkbook.Close SaveChanges:=True
    or
    ActiveWorkbook.Close SaveChanges:=xlSaveChanges

    There is no constant xlsSaveChanges.

Posting Permissions

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