All -
I have code tied to a button on my worksheet that saves the file to the users desktop, then emails the workbook to another person. This works fine on my machine (XP, 2007) and several other people's machines.
However, some people keep getting the "Run-Time error 429: ActiveX component can't create object" error. It is getting hung up on the following line: "Set OutApp = CreateObject("Outlook.Application")".
All of these people have Outlook and it is open when they run this. Here is my code:
Sub Email()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "Subject"
.HTMLBody = "Body"
.Attachments.Add ActiveWorkbook.FullName
.Send '
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I did post this question on Ask Yahoo at http://answers.yahoo.com/question/index…04132153AA0SeJK but have received no responses (except for spam).
I have searched for answer to this for awhile now and I am coming up empty. Any thoughts on what this could be would be appreciated.
BTW: this is my first post here, so my apologies if I have omitted valuable information. Please let me know and I give you whatever I can.
Thanks,
Tyler