Mail macro stopped working on other computers with no error message

shaolinjehzu

New Member
Joined
Jul 29, 2015
Messages
1
I've created a macro in a module in a macro-enabled workbook to send mails to project members based on the macro I found here: Spreadsheet Page Excel Tips: Sending Personalized Email From Excel
There are 3 PC's, all running Office 2010 Professional Plus on Windows 7 with the exact same settings applied (macro and other security settings, references in VBE etc.).
Upon reformatting two of the computers and reinstalling the same Office 2010, the macro doesn't work on those computers anymore, but no error message is displayed either: it runs the full code but ends up doing nothing.
I've rechecked all settings, and also checked if those two computers can run any other macros (all macros beside this one still work); I can not find any difference whatsoever.

Here's the macro:
Code:
Option Explicit
 
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
 
Sub projectname()
    Dim Email As String, Subj As String
    Dim Msg As String, URL As String
    Dim mailcc As String, mailbcc As String

    Subj = "subject"
     
    Msg = ""
    Msg = Msg & "message line 1," & vbCrLf & vbCrLf
    Msg = Msg & "message line 2"
        Msg = Msg & vbCrLf & "message line 3"
     
    Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
    Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
    Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
    
'************************mail addresses**************************************************
        Email = "mail1@mail.com"
        mailcc = "mail2@mail.com"
        mailbcc = "mail3@mail.com"
     
     'Create the URL
     URL = "mailto:" & Email & "?cc=" & mailcc & "&bcc=" & mailbcc & "&body=" & Msg & "&subject=" & Subj
     
     'Execute the URL (start the email client)
    ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
     

End Sub

The macro allows the user to send mails without attachments to all email addresses specified in To, CC and BCC in Windows Live Mail. (Which we use on all 3 computers)
Any idea why it won't work anymore after reinstalling Office? A last solution would be to switch to Outlook, which I know is much more compatible with Office, but I'd rather not...

Thank you in advance for your time.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,215,558
Messages
6,125,511
Members
449,236
Latest member
Afua

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top