ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run-Time error 429 (https://www.excelbanter.com/excel-discussion-misc-queries/243725-run-time-error-429-a.html)

tankerman

Run-Time error 429
 
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

tankerman

Run-Time error 429
 
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


"tankerman" wrote:

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


Dave Peterson

Run-Time error 429
 
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.

tankerman wrote:

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

"tankerman" wrote:

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


--

Dave Peterson

tankerman

Run-Time error 429
 
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

"Dave Peterson" wrote:

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.

tankerman wrote:

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

"tankerman" wrote:

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


--

Dave Peterson



All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com