Macro code to exit Excel without prompt

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

can someone please provide the VB macro code that will exit excel without prompt, also with prompts please. (Prompting meaning "Do you want to Save book1.xls" etc.

Thanks

Adam
 
ActiveWorkbook.Saved=true




Adam said:
Dear all,

can someone please provide the VB macro code that will exit excel without
prompt, also with prompts please. (Prompting meaning "Do you want to Save
book1.xls" etc.
 
Because the Saved property is being set to True, Excel acts as if the
workbook has already been saved. This code does not save th
workbook.

Rolli
 
Adam,

Application.DisplayAlerts = False
Application.Quit

to close Excel without prompts, or omit the first statement to get prompts.

HTH,
Nikos

Adam said:
Dear all,

can someone please provide the VB macro code that will exit excel without
prompt, also with prompts please. (Prompting meaning "Do you want to Save
book1.xls" etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top