PDA

View Full Version : run-time error 429



counterrojo
11-09-2011, 04:17 PM
Hi,

I am trying to use a macro on my Win 7 64bit machine. This code works on my xp machine. I get run-time error '429': ActiveX component can't create object on: Set oOutlookApp = GetObject(, "Outlook.Application"). I'm wondering if this is a 64 bit problem or if something else is causing it. The macro is supposed to email a word document:
Option Explicit
Private Sub CommandButton1_Click()
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
MsgBox "Document needs to be saved first"
Exit Sub
End If
On Error GoTo 0
ActiveDocument.Save
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = "FinanceShiningStars@davita.com"
.Subject = "Completed Finance Shining Star Core Value Pin Form"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Document as attachment"
.Display
End With
If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub


Thanks,

Michael

Frosty
11-09-2011, 04:25 PM
Some google searching indicates this may be a couple of different things-- from 2010 (64 bit/32 bit doesn't matter) removing some external access to public methods, to up-to-date virus protections preventing the execution of this code.

Other than that, don't have the ability to test this for you... if you find out more info, please post it here for everyone else as well.

Thanks!

glenndrew
11-24-2011, 03:59 AM
Hello,
i also faced this problem many times but i fixed it,

Runtime error 429: “ActiveX component can’t create object”
Here is a solution to this error:
Reinstall Windows Script
Repair Windows Script File Information in Registry
Reregister Concerning File
Reset Internet Explorer Settings
Restore your Computer
Repair System Files