I am having problems with code to send an e-mail with a file attachment.
I am using Ron Debruin's method as follows:
Sub Mail_workbook_Outlook()
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "ron@debruin.nl"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
At the line "Set OutApp = CreateObject("Outlook.Application") I get an error message as follows:
Runtime Error '429'
Active X Component can't create object.
I am using Outlook Express for E-mail
Can anybody help me? Thanks so much, Frank
I am using Ron Debruin's method as follows:
Sub Mail_workbook_Outlook()
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "ron@debruin.nl"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
At the line "Set OutApp = CreateObject("Outlook.Application") I get an error message as follows:
Runtime Error '429'
Active X Component can't create object.
I am using Outlook Express for E-mail
Can anybody help me? Thanks so much, Frank