Hi,
I'm using the following code in VBA (in Excel) to try to e-mail a number of attachments to a list of recipients :
VB Code:
Sub Send_Emails() Sheets("Menu").Select Application.ScreenUpdating = False Application.StatusBar = "E_Mailing RFQs to Suppliers ..." Sheets("DailyRFQs").Select ' On Error GoTo cleanup For Each VCODE In Range("VCODE") Set objCDOMessage = CreateObject("CDO.Message") Set objCDOConfig = CreateObject("CDO.Configuration") With objCDOMessage Set .Configuration = objCDOConfig .To = VCODE.Offset(0, 2).Value .Subject = "RFQ: " & VCODE.Offset(0, 12).Value & " - " & VCODE.Value & " " & VCODE.Offset(0, 1).Value .TextBody = vbNewLine & vbNewLine & _ "Text" .AddAttachment VCODE.Offset(0, 7).Value .AddAttachment VCODE.Offset(0, 8).Value .AddAttachment VCODE.Offset(0, 9).Value .AddAttachment VCODE.Offset(0, 11).Value .Send 'Or use Display .Display ' VCODE.Offset(0, 9).Value = "YES" End With Set iMsg = Nothing Next cleanup: Set objCDOMessage = Nothing Set objCDOConfig = Nothing Application.ScreenUpdating = True End Sub
On execution I get the following message :
Run-time error '-2147220960 (80040220)':
The "SendUsing" configuration value is invalid.
Does anyone have any suggestions how I can get around this ? I'm tearing me hair out here !!




Reply With Quote