Windows Live Mail (WLM) and Excel problem

Hi all

Because Windows Mail is removed from Windows 7 you must install a third party mail program
or use the free Windows Live Mail (also with newsgroups).
I see that a lot of people start using WLM now but Office has a problem with this program.
Note: you have the same problem if you use WLM in Vista
If you set WLM as your default mail program and try to mail from Office you get a general mail failure error
two times, the third time it is working. The reason for this is that Windows Live Mail isn’t fully
MAPI-qualified like Windows Mail or Outlook.
You have the same problem when you want to mail with SendMail in VBA so I want to change all my SendMail
code examples on my site with this workaround but hope you can test it for me before I do that.

Using a loop seems the best way as a workaround.

On Error Resume Next
For I = 1 To 3
.SendMail “”, _
“This is the Subject line”
If Err.Number = 0 Then
Exit For
End If
Next I
On Error GoTo 0

Set WLM as your default mail program first before you test the workbook that you can download here:

When you push the button in the workbook it creates a mail with the active sheet
Note: it will not send the mail it this example but show it.

I like to know this :
Is it working the first time when you push the button?
Is there a better way?

Thanks for testing

Regards Ron de Bruin

Posted in Uncategorized

11 thoughts on “Windows Live Mail (WLM) and Excel problem

  1. I don’t have Windows 7 so I can’t test for you but I do have a quick comment about your code. In the event that Err.Number is 0 then you exit the for loop without setting On Error GoTo 0, you might want to move the error handling outside the for loop to ensure that you don’t accidently hide errors.

  2. Ron,

    You do have a potential problem with that error setting.

    You want something like:

    On Error Resume Next
    For I = 1 To 3
    .SendMail “”, _
    “This is the Subject line”
    If Err.Number = 0 Then
    Exit For
    end if
    Next I
    On Error GoTo 0

    Otherwise, you’ll leave the loop with the exit for and error handling will still be off.

  3. Hi Dave

    Yes that’s correct, I mean that in this tester it is no problem
    that it is off after it create the mail but I agree that in the final code it must be corrected.

    Have a nice day

  4. If you are talking the scenario where you are using WLM and an SMTP server, and you don’t need to pause at an email program to edit the final message, use one of several smtp sending programs – the VBA code to fire them off is simple – offers a free cut down sender. Alternatively someone could cobble up a .net .dll that can do the job.

  5. I gave it a quick try, and it does seem to work (you should have received the email).
    Let me know if I need to try other things. I’m normally using Outlook 2007 as default and using WLM for some private email, but it’s really easy making WLM the default MAPI client in Win7.

  6. Thanks Jurgen

    Seems to work also OK on a few of my VPC’s(Vista and win 7)
    I will update all my SendMail code examples this week and start with
    a new version of my mail add-in for Excel 207-2010 with OE, Windows Mail and Windows Live Mail

  7. Hi Ron,

    I use the sendmail code example in a sheet I use, it works great in outlook but I still can’t get it to work in WLM.
    I’ve tried what you suggested from your site but no joy.
    I’m using WLM 2011, the code starts WLM and i get a message asking to allow the message to be sent, I click ‘send’ but it still errors out.
    Any ideas?

Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.