View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bernard Foot Bernard Foot is offline
external usenet poster
 
Posts: 4
Default Sendmail: Problem when used after a Userform

I have a VBA application which requires the same workbook
to be sent (using sendmail) to multiple recipients, one
at a time. (The VBA loops through a list of users,
amending the workbook before each mailing.)

The first recipient mailing works OK, but Excel crashes
when it tries to process sendmail for the second time.
This problem only arises where the sendmail loop appears
after a userform.show in the same module. I've tried
using both userform.hide and unload userform, putting in
a delay between sendmails, putting the userform.show into
a different module. The problem occurs even if I show a
userform with absolutely nothing in it, and just
terminate the form.

Any ideas?