Close Excel after mail merge

C

Carim

Hi All,

After a mail merge, closing Excel prompts the alert " Do you want to
save the excel file ?" Getting rid of this alert message seems tough
....
Application.DisplayAlerts is not operative
oXL.Quit does not allow to skip this alert ...
I am looking for your recommendations
Thanks in advance
Carim
 
Z

zkid

You will need to close the workbook before quitting. You can tell it to
close the workbook without saving the changes.
 
C

Carim

Just tried to close workbook ... but unfortunately the Alert message
keeps coming ...
Still looking for suggestions.
Thanks in advance
Carim
 
J

Jezebel

You need to tell Excel that you don't want to save the workbook ---

ActiveWorkbook.Saved = true
 
C

Carim

Hi Jezebel,

Thanks a lot ... I think this will solve my problem ...
I did not know this property
Thanks again
Cheers
Carim
 
C

Carim

Hi,

For the sake of documentation, the solution is a bit different ...
Thanks to Cindy ... unlinking the template to its source is a
prerequisite :
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
Then Closing the template without saving changes ...
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

HTH
Carim
 
J

Jezebel

That's for closing Word. Your subject line asks about closing Excel, which
doesn't do it that way.
 

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

Top