ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel crashes on closing after SendMail (https://www.excelbanter.com/excel-programming/372183-excel-crashes-closing-after-sendmail.html)

[email protected]

Excel crashes on closing after SendMail
 
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


Peter T

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





All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com