View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JG Scott JG Scott is offline
external usenet poster
 
Posts: 20
Default Excel shuts down after opening dialog

After my vba code (below) displays the SendMail dialog and the email is
sent, Excel displays the message "Excel has encountered a problem and
will shut down". Excel then shuts down and restarts. Does anyone know
why and how to prevent Excel from shutting down?

Thanks.


If MsgBox("Would you like to attach the Sample Report Request to an
email now?", vbYesNo) = vbYes Then
Application.Dialogs(xlDialogSendMail).Show

Else
End If

End Sub