gkisystems
Board Regular
- Joined
- Apr 20, 2012
- Messages
- 76
I have the following macro that works fine except for 1 exception - it does not enter any text as the body of the message. How can I edit this code so it includes a message for the body of the email?
Sub EmailRDReport()
'Working in Excel 2010 with Lotus Notes
Dim wb As Workbook
Dim I As Long
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" & vbNewLine & _
"be no VBA code in the file you send. Save the" & vbNewLine & _
"file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error Resume Next
For I = 1 To 3
wb.sendmail "emailaddress1@example.com, emailaddress2@example.com, emailaddress3@example.com", _
"My Subject Line Goes Here"
If Err.Number = 0 Then Exit For
Next I
On Error GoTo 0
End Sub
Sub EmailRDReport()
'Working in Excel 2010 with Lotus Notes
Dim wb As Workbook
Dim I As Long
Set wb = ActiveWorkbook
If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" & vbNewLine & _
"be no VBA code in the file you send. Save the" & vbNewLine & _
"file first as xlsm and then try the macro again.", vbInformation
Exit Sub
End If
End If
On Error Resume Next
For I = 1 To 3
wb.sendmail "emailaddress1@example.com, emailaddress2@example.com, emailaddress3@example.com", _
"My Subject Line Goes Here"
If Err.Number = 0 Then Exit For
Next I
On Error GoTo 0
End Sub