View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Excel crashes on closing after SendMail

I haven't tried your code but effectively you are doing this

apExcel.Application.Quit

Try removing the .Application. Also probably better to move it outside the
With - End With, ie

apExcel.Quit

Regards,
Peter T

wrote in message
ups.com...
Hi Everyone,

the following code:

Set apExcel = New Excel.Application
With apExcel
.Workbooks.Open App.Path & "\test.xls"
.Workbooks(1).SendMail ", "Test"
.Workbooks(1).Close
.Application.Quit
End With
Set apExcel = Nothing


causes Excel to crash on closing (.Application.Quit). The mail is
getting sent successfully.

If I comment .SendMail line, everything works just fine.

I do not know if this info is relevant, but
I am using Thundebird Email and have McAfee virus scan which blocks
port 25 for mass mailing.


Please help,

Alex