MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Emailing with Application.Dialogs(xlDialogSendMail).Show

Posted by James on January 15, 2002 4:19 AM


I'm trying to email a workbook using Application.Dialogs(xlDialogSendMail).Show

but keep getting that Outlook "could not open one or more attachments". The email looks ready to go, but the file is not in the email.

This is probably more an Outlook problem but would be great if anyone could help.


Posted by Frank Rizzo on January 15, 2002 8:17 AM

I have received the same error message. The first time you email using my spreadsheet it will send fine, but if you try to email it a second time, I get the error message.

I was able to repeatedly send an email attachment from my spreadsheet without errors by first closing Outlook and then using the following code:

Application.ScreenUpdating = False
Application.Dialogs(xlDialogSendMail).Show _
arg1:="<email address>", _
arg2:="<Subject Line>"
ActiveWorkbook.Close SaveChanges:=False

My only problem is the sheet I send contains links to other sheets inside the same workbook and when I send the sheet I am losing data. But I think I can work around that.

If you find a solution that works while Outlook is open, post it.