ActiveX component can't create object

CBROWN1

New Member
Joined
Sep 28, 2009
Messages
43
Hi-
I have been running a macro to send a workbook via email for some time now without any issues.

I have recently had my laptop rebuilt for windows 2007 and now the macro is giving me a Run-time error '429'. ActiveX component can't create object.

Any ideas? Code is below; I have highlighted the line of code that seems to be causing the problem.

Any help would be much appreciated.
Thanks,

Sub SendWB()
'
'
Filename = InputBox("Please provide a name for this request")
ThisWorkbook.SaveAs (Environ("userprofile") & Application.PathSeparator & "Desktop" & Application.PathSeparator & Filename)

Dim myOutlook As Object
Dim myMailItem As Object


Set otlApp = CreateObject("Outlook.Application")
Set otlnewmail = otlApp.CreateItem(olMailItem)
fname = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name

With otlnewmail
.To = Cells(2, 5)
.CC = Cells(2, 3)
.Subject = "Amendment Request " & Filename
.Body = "Please review the attached amendment request " & Filename
.Attachments.Add fname
.Display

End With


Set otlnewmail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing

End Sub
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
This may not be relevant as you are using object, but have you tried looking at the References and set to use Microsoft Outlook.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,734
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top