I'm currently trying to automate the distribution of a number of e-mails using VBA in excel. The relevant information is held in the spreadsheet and the VBA module loops through the list attaching relevant files. I am on a server and the e-mail client we are using is Groupwise. I was using Outlook to perform this task but have recently been experiencing MAPI errors since converting to 2003 so have changed my code so it doesn't use Outlook. When running the module below, I get the following error message: The "SendUsing" configuration value is invalid.
Code
Sub Send_RFQs()
Dim iMsg As Object
Dim iConf As Object
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 iMsg = CreateObject("CDO.Message")
With iMsg
.To = VCODE.Offset(0, 2).Value
.Subject = "RFQ: " & VCODE.Offset(0, 12).Value & " - " & VCODE.Value & " " & VCODE.Offset(0, 1).Value
.From = "[email protected]"
.TextBody = vbNewLine & vbNewLine & _
"Dear " & VCODE.Offset(0, 3).Value & "," & vbNewLine & vbNewLine & _
"Please find RFQ attached. Please also find word documents instructing you how to complete the RFQ. Please contact the person detailed below with any queries." & vbNewLine & vbNewLine & _
"*** NOTE: A NEW COLUMN HAS BEEN ADDED TO THE SPREADSHEET FOR YOUR COMMENTS. THERE IS ALSO A FUNCTION ENABLING YOU TO CHOOSE THE COLUMNS YOU WANT TO VIEW. THIS CAN BE ACTIVATED BY PRESSING CTRL + Q. ***" & vbNewLine & vbNewLine & _
"Please could you sign and return the acceptance form also, if you haven't already done so." & vbNewLine & vbNewLine & _
"Thanks and regards," & vbNewLine & vbNewLine & _
VCODE.Offset(0, 4).Value & vbNewLine & vbNewLine & _
"Procurement Specialist" & vbNewLine & _
"Westland Helicopters Ltd." & vbNewLine & vbNewLine & _
"Tel: 01935 70" & VCODE.Offset(0, 6).Value & vbNewLine & _
"Fax: 01935 704508" & vbNewLine & _
"e-Mail: " & VCODE.Offset(0, 5).Value
.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
End With
Set OutMail = Nothing
Next
cleanup:
Set iMsg = Nothing
Application.ScreenUpdating = True
Sheets("Menu").Select
Range("DAILYUP").FormulaR1C1 = "=TODAY()"
Range("DAILYUP").Select
CPV
Application.StatusBar = False
Range("A1").Select
MsgBox ("Ensure all processed RFQs are transferred to the 'Archive' folders to avoid duplication")
End Sub
Display More
Any advice would be greatly appreciated. This is my first thread so please let me know if I've done anything wrong !