Run-Time error 429

T

tankerman

When my company bought new computers I have started getting this error

Run-time error 429
ActiveX component can't create object

I know it's probably a reference but for the life of me I can not seem to
find which one it is.

Any help would be appreciated

DWB
 
T

tankerman

This is my code attached to a button, it fails on this line
Set OutApp = CreateObject("Outlook.Application")

Sub Mail_Sheet_Outlook_Body()
' Don't forget to copy the function RangetoHTML in the module.
' Working in Office 2000-2007
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

Set rng = Nothing
Set rng = ActiveSheet.UsedRange
'You can also use a sheet name
'Set rng = Sheets("YourSheet").UsedRange

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.Recipients.Add "ASPHALT H2S"
.CC = ""
.BCC = ""
.Subject = Range("E4")
.HTMLBody = RangetoHTML(rng)
.DISPLAY
End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

Any help would be appreciated

DWB
 
D

Dave Peterson

I'd guess that you don't have Outlook installed.

Did your company install that program, too?

ps. This is not a reference error.

The code uses late binding (Dim OutApp as Object) and doesn't need the
reference.

But your program can't find Outlook.
 
T

tankerman

I did a detect and repair and found out that Office 2003 did an install, I'm
guessing but I thinki out new computers came with Office 2000. After the
install when I started up OutLook it did a initial setting on startup (I
think it said initial setting anyway) and now it works fine.

Thanks Dave for your help
Tankerman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top