Email differences Windows XP and Windows 7

AlanAnderson

Board Regular
Joined
Jun 7, 2010
Messages
134
Hi All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
The following two routines which I got from Ron de Bruin’s site have worked really well on several different machines running Excel 2003 and 2007. These machines have mostly been running various “flavours” of Windows XP><o:p></o:p>
<o:p></o:p>
I am trying to run this now on another machine using Windows 7 and Excel 2007 and it just does not work. <o:p></o:p>
<o:p></o:p>
It just drops down into the error routine <o:p></o:p>
“EMailProblem:<o:p></o:p>
MsgBox "Problem with Internet connection. These emails have probably not been sent. Check audit file and contact your support staff!"<o:p></o:p>
<o:p></o:p>
Is there something I should add / delete / change to allow for Windows 7 and/or other versions of Windows??<o:p></o:p>
<o:p></o:p>
Regards,<o:p></o:p>
<o:p></o:p>
Alan<o:p></o:p>

Code:
<o:p></o:p>
[SIZE=3][FONT=Times New Roman]' CLIENTS/ACCOUNTS SENDING ROUTINE (USES EMAIL LIST CREATED IN FIRST ROUTINE ABOVE)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Sub CDO_Mail_Small_Text2()<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vTruck As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vTrailer As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vTruckReg As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vName As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vRef As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vCommodity As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vRoute As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vStatus As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vAddress As String              'email address for client<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vAcsAddress As String           'email address for accounts<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim iMsg As Object<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim iConf As Object<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim strbody As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim LastRow As Long<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vFullDate As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   ' FOLLOWING VARIABLES REQUIRED TO SEND EMAILS. ONES MARKED 2 APPLY IN ALL CASES.IF MARKED 1 ONLY REQUIRED _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   WHERE EMAIL PROBLEMS REQUIRE SMTP TO BE SET WITHIN ROUTINE<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSMTP As String             '1<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vServerPort As Integer      '1<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentFromAdd As String      '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentToAdd As String        '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentByName As String       '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vServerPort = Sheets("Dates").Cells(2, 6)     ‘  This value is currently set at 25<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentFromAdd = Sheets("Dates").Cells(2, 8)      ‘  This value is currently set at <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName w:st="on">afc@bdsmw.com</st1:PersonName><o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentToAdd = Sheets("Dates").Cells(2, 7)  ‘  This value is currently set at afctest1@bdsmw.com<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentByName = Sheets("Dates").Cells(2, 9)  ‘  This value is currently set at Alan<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSMTP = Sheets("Dates").Cells(2, 5)   ‘  This value is currently set at smtp.bdsmw.com<o:p></o:p>[/FONT][/SIZE]
<o:p></o:p>
[SIZE=3][FONT=Times New Roman]   '    Dim Flds As Variant<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vWho As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   LastRow = Sheets("eMail").Cells(Rows.Count, 2).End(xlUp).Row<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   For i = 2 To LastRow<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vTruck = Sheets("EMail").Cells(i, 1)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vDriver = Sheets("EMail").Cells(i, 2)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vTruckReg = Sheets("EMail").Cells(i, 12)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vTrailer = Sheets("EMail").Cells(i, 3)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vName = Sheets("EMail").Cells(i, 4)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vRef = Sheets("EMail").Cells(i, 5)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vCommodity = Sheets("EMail").Cells(i, 6)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vRoute = Sheets("EMail").Cells(i, 7)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vStatus = Sheets("EMail").Cells(i, 9)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vContact = Sheets("EMail").Cells(i, 8)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vAddress = Sheets("EMail").Cells(i, 10)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vWho = Sheets("Email").Cells(i, 13)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vComments = Sheets("EMail").Cells(i, 17)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vFullDate = Sheets("EMail").Cells(i, 18)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Set iMsg = CreateObject("CDO.Message")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Set iConf = CreateObject("CDO.Configuration")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   'Following lines between XXXXXXXXXXXX are only required if regular email connection does not exist. _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       If 25 does not work replace with 465<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '      iConf.Load -1    ' CDO Source Defaults<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '      Set Flds = iConf.Fields<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '       With Flds<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '           .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '           .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '                          = vSMTP  ' "smtp.broadbandmw.com"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '           .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Val(vServerPort)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '           .Update<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] '      End With<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   'Above lines between XXXXXXXXXXXX are only required if regular email connection does not exist<o:p></o:p>[/FONT][/SIZE]
<o:p></o:p>
[SIZE=3][FONT=Times New Roman]   strbody = "For Attention:           " & vContact & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Please note the following status of your load" & vbNewLine & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Fleet No                 " & vTruck & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Driver Name              " & vDriver & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Truck Registration       " & vTruckReg & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Trailer no               " & vTrailer & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Client Name              " & vName & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Client / Load Reference  " & vRef & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Commodity / Load         " & vCommodity & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Comments                 " & vComments & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Route                    " & vRoute & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Current Status           " & vStatus & vbNewLine & _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             "Date & Time of Position  " & vFullDate & vbNewLine<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]           <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]             <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]On Error GoTo EMailProblem<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   With iMsg<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       Set .Configuration = iConf<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]      ' .To = "<st1:PersonName w:st="on">afc@bdsmw.com</st1:PersonName>"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .To = vAddress<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .CC = ""<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .BCC = ""<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .From = vSentByName & "   <" & vSentFromAdd & ">"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .Subject = "Current Status of load. Client Reference: ....." & "     " & vRef<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .TextBody = strbody<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .Send<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   End With<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vToday As Date<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vToday = Now<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   ' vToday = Format(Now, "MMDDYYYY HHMM")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   WriteRowAudit = Sheets("EMailAudit").Cells(Rows.Count, 1).End(xlUp).Row + 1<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 1).Value = vTruck<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 2) = vDriver<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 3) = vTrailer<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 4) = vName<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 5) = vRef<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 6) = vCommodity<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 7) = vRoute<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 8) = vStatus<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 9) = vContact<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 14) = vEMail<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 11) = vToday  'date<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 12) = vWho  'Ac/Cl<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 13) = vTruckReg<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 10) = vAddress<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                   Sheets("EMailAudit").Cells(WriteRowAudit, 15) = vComments<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Next i<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]GoTo RtnEnd<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]EMailProblem:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] MsgBox "Problem with Internet connection. These emails have probably not been sent. Check audit file and contact your support staff!"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]GoTo endprg<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]RtnEnd:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]MsgBox "EMail connection seems in order. EMails sent"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]endprg:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End Sub<o:p></o:p>[/FONT][/SIZE]

The followIng routine just goes straight to the following error routine:
EMailProblem:<o:p></o:p>
MsgBox "Problem with Internet connection. Do NOT attempt to send emails at this stage!"<o:p></o:p>


Code:
[SIZE=3][FONT=Times New Roman]Sub CDO_Mail_Test()<o:p></o:p>[/FONT][/SIZE]
<o:p></o:p>
[SIZE=3][FONT=Times New Roman]   Dim iMsg As Object<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim iConf As Object<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim strbody As String<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   ' FOLLOWING VARIABLES REQUIRED TO SEND EMAILS. ONES MARKED 2 APPLY IN ALL CASES.IF MARKED 1 ONLY REQUIRED _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   WHERE EMAIL PROBLEMS REQUIRE SMTP TO BE SET WITHIN ROUTINE<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSMTP As String             '1<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vServerPort As Integer      '1<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentFromAdd As String      '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentToAdd As String        '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Dim vSentByName As String       '2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vServerPort = Sheets("Dates").Cells(2, 6)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentFromAdd = Sheets("Dates").Cells(2, 8)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentToAdd = Sheets("Dates").Cells(2, 7)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSentByName = Sheets("Dates").Cells(2, 9)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   vSMTP = Sheets("Dates").Cells(2, 5)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Set iMsg = CreateObject("CDO.Message")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   Set iConf = CreateObject("CDO.Configuration")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'Following lines between XXXXXXXXXXXX are only required if regular email connection does not exist If 25 does not work replace with 465<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'        iConf.Load -1    ' CDO Source Defaults<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'        Set Flds = iConf.Fields<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'         With Flds<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'             .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'             .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'                            = vSMTP  ' "smtp.broadbandmw.com"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'             .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Val(vServerPort)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'             .Update<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'         End With<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]'Above lines between XXXXXXXXXXXX are only required if regular email connection does not exist<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   strbody = "EMail Correct - Proceed to next option"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]On Error GoTo EMailProblem<o:p></o:p>[/FONT][/SIZE]
<o:p></o:p>
[SIZE=3][FONT=Times New Roman]   With iMsg<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       Set .Configuration = iConf<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       ' .To = "<st1:PersonName w:st="on">afc@bdsmw.com</st1:PersonName>"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .To = vSentToAdd<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .CC = ""<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .BCC = ""<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .From = vSentByName & "   <" & vSentFromAdd & ">"  ' """Derek"" <DEREK@BROADBANDMW.COM>"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .Subject = "EMail Status "<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .TextBody = strbody<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]       .Send<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]   End With<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]GoTo RtnEnd<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]EMailProblem:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] MsgBox "Problem with Internet connection. Do NOT attempt to send emails at this stage!"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] GoTo endprg<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]RtnEnd:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]MsgBox "EMail connection seems in order. Proceed to send eMails"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]endprg:<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]End Sub<o:p></o:p>[/FONT][/SIZE]
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The On Error GoTo directive causes program execution to jump out of any line which triggers an error to a piece of code written by the programmer to attempt to handle the error.

In this case it's not helping because instead of the program stopping at the line which is triggering the error and reporting the exact nature of the error it's jumping to a piece of code which doesn't distinguish between the types of error which may have triggered it.

Comment out any On Error directives by placing a single apostrophe in front of them and try running your program again. It will stop on the exact line which triggers the error and tell you what (it thinks) the error actually is. When prompted End or Debug, select Debug to view the exact command VBA is objecting to.
 
Upvote 0
Hi Ruddles,

Thanks for the help. It looks like I was barking up the wrong tree. My client had changed some of the data files when copying accross.

By turning off the on error it helped me narrow down the problem.

Thanks again
Alan
 
Upvote 0
I wish - unfortunately I was stupid in that I should have hidden and/or protected the sheet. Anyway, I always learn the hard way
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

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