What does the below error mean and do I fix it ?
Runtime Error 2147467259 (80004005)
It fails on ==> Set M = O.CreateItem(olMailItem)
' Remember to add REFERENCE to Microsoft Outlook Object Library
Dim Msg As String
' Msg = "Dear " & Firstname & ",<P> & _
' "Your statement balance as of " & Date & " is " & Format(CreditLimit,"Currency") & "<P>" & _
' "If you have any questions please contact me at (999-9999). "
Msg = "This is the message"
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
'.HTMLBody = Msg
' .Body = Txt
' If you use olFormatPlain
.HTMLBody = "This is the message"
.To = "myemaiaddress"
.Subject = "Statement Balance " & Now()
.Display
' .Display to see e-mail screen
' .Send
' .Send to send without e-mail screen
End With
Set M = Nothing
Set O = Nothing
Runtime Error 2147467259 (80004005)
It fails on ==> Set M = O.CreateItem(olMailItem)
' Remember to add REFERENCE to Microsoft Outlook Object Library
Dim Msg As String
' Msg = "Dear " & Firstname & ",<P> & _
' "Your statement balance as of " & Date & " is " & Format(CreditLimit,"Currency") & "<P>" & _
' "If you have any questions please contact me at (999-9999). "
Msg = "This is the message"
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
'.HTMLBody = Msg
' .Body = Txt
' If you use olFormatPlain
.HTMLBody = "This is the message"
.To = "myemaiaddress"
.Subject = "Statement Balance " & Now()
.Display
' .Display to see e-mail screen
' .Send
' .Send to send without e-mail screen
End With
Set M = Nothing
Set O = Nothing