Consulting

Results 1 to 4 of 4

Thread: Close workbook without save prompt?

  1. #1
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location

    Close workbook without save prompt?

    I have a macroenabled workbook at work that helps my colleagues.

    When the user chooses to save the workbook it creates a copy of the first sheet and saves it as a new workbook.
    This because I don't want to save it with the macrocode, only the sheet needs to be saved.

    After that is done the macro closes the "new" workbook and goes back to the macroenabled workbook.
    At this stage the user needs to close Excel but he/she gets the prompt "do you want to save".
    How can I disable this prompt?

    I have tried with application.displayevents = false in beforeclose sub
    But that doesn't seem to work.
    Any suggestions?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why don't you close Excel in the code?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location
    You mean close Excel in beforeclose sub?

    That could work.

  4. #4
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location
    It works perfectly!

    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
  •