PDA

View Full Version : Excel Hangs when sending multiple CDO messages



scott56
12-19-2008, 02:29 PM
Hi,

I have developed a basic Excel workbook that will eventually create and send and email via CDO messaging. I have sourced most of the mail code from this site and other VBA sites.

As part of the workbook I want to give the user the option to pause sending email and then continue. This is to provide the ability to stop sending the multiple emails if the user has mistakenly started sending.

It all works fine to send the emails and also if user selects pause and waits for a period before clicking on exit or continue....but if the user clicks pause and then quickly clicks continue and then pause again the application will proceed to send emails but will not allow the user to close out of excel...

On reviewing the TCP connections via TCPView it appears when the user clicks on pause and continue too quickly a connection is created that is not closed and this stops Excel from finishing properly..

If anyone can suggest how I can resolve this either through the redesign of my form or the approach I am taking it would be appreciated....

I have also tried to use MAPI settings to send the email, but this won't be a viable solution as I need to be able to send the emails from a specific account..

Any help appreciated..:help

Note : to test the attached file you will need to include your own gMail account and password, along with a test email account to receive...