Run-Time Error '429': ActiveX component can't create object 
Author Message
 Run-Time Error '429': ActiveX component can't create object

I have the following problem with microsoft Visual studio or Office 2000

I write the following program in Visual Basic 6.0, try to auto run a
macro which resides in excel 2000. However,
it runs OK when excel 2000 is Open. When excel is closed, it will give
an error: Run-Time Error '429': ActiveX
component can't create object.

I try to uninstall or reinstall office 2000, it does not solve the
problem. I suspect something is missing in my
windows 2000(However, I just resintall windows 2000 and everything seems
fine), or something is wrong with the
activeX server. Could anyone have any idea what is wrong with that?

Thanks in advance.

Sub main()
Dim myXL As Object
Dim sht

Set sht = CreateObject("Excel.Sheet")
Set sht = GetObject("R:\website\w3website\arb20\chart.xls")
sht.Application.Visible = True
sht.Parent.Windows(1).Visible = True
sht.Application.Run "arb20graph"

'Set myXL = GetObject("R:\website\w3website\arb20\chart.xls")
'myXL.Application.Visible = True
'myXL.Parent.Windows(1).Visible = True

'myXL.Application.run "arb20graph"

End Sub

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Run-Time Error '429': ActiveX component can't create object

Quote:

> I have the following problem with microsoft Visual studio or Office
> 2000 I write the following program in visual basic 6.0, try to auto
> run a macro which resides in excel 2000. However, it runs OK when
> excel 2000 is Open. When excel is closed, it will give an error:
> Run-Time Error '429': ActiveX
> component can't create object.

> I try to uninstall or reinstall office 2000, it does not solve the
> problem. I suspect something is missing in my windows 2000(However, I
> just resintall windows 2000 and everything seems fine), or something
> is wrong with the activeX server. Could anyone have any idea what is
> wrong with that?

yzhang:

I think the problem is that you are using the CreateObject and the
GetObject both at the same time on the same object.  You only have to
use one or the other then you can use the objects properties, methods,
and events to control the object.  The CreateObject is used when no
instance of the object exists.  The GetObject works when there is an
instance of the object already running (you will get that same error
message if you try to get and instance of an object that is not running
with getobject).  This is what I did:

Option Explicit
'Make sure you add a reference to the ms.excel lib - I used Excel 8.0.

Private Sub Form_Load()
  Dim MyApp As Excel.Application
  Set MyApp = CreateObject("Excel.application")

  MyApp.Visible = True
  MyApp.Workbooks.Open "c:\junk.xls"
  MyApp.Run "macro1"
End Sub

Let me know if you have any questions on this and how it turns out.

Dan Griffis

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Run-Time Error '429': ActiveX component can't create object
Hi yzhang,

There is nothing wrong with your Office, I presume.

Try following code to prove it:

    Dim ExcelApp As Object
    Dim sFileName As String

    Set ExcelApp = CreateObject("Excel.Application")

    ExcelApp.Visible = True

    sFileName = ExcelApp.GetOpenFilename("Excel Files (*.xls), *.xls")

    If sFileName <> "False" Then
        ExcelApp.Workbooks.Open FileName:=sFileName

        MsgBox "File " & sFileName & " is opened in Excel!" & vbCrLf & _
            "Pressing OK Button will close it and Excel Application"
        ExcelApp.ActiveWorkbook.Close
    Else
        MsgBox "Cancel button was selected!"
    End If

    ExcelApp.Quit

This code will open and close new instance of Excel every time you run
it.

You can open any workbook from the dialog.

To run some code from the opened *.xls workbook you should place it NOT
in Auto_Open() procedure, but in  Sub Workbook_Open() event procedure
you create in ThisWorkbook code module.

Hope this will help you.

With respect

Alex


Quote:

> I have the following problem with microsoft Visual studio or Office
2000

> I write the following program in visual basic 6.0, try to auto run a
> macro which resides in excel 2000. However,
> it runs OK when excel 2000 is Open. When excel is closed, it will give
> an error: Run-Time Error '429': ActiveX
> component can't create object.

> I try to uninstall or reinstall office 2000, it does not solve the
> problem. I suspect something is missing in my
> windows 2000(However, I just resintall windows 2000 and everything
seems
> fine), or something is wrong with the
> activeX server. Could anyone have any idea what is wrong with that?

> Thanks in advance.

> Sub main()
> Dim myXL As Object
> Dim sht

> Set sht = CreateObject("Excel.Sheet")
> Set sht = GetObject("R:\website\w3website\arb20\chart.xls")
> sht.Application.Visible = True
> sht.Parent.Windows(1).Visible = True
> sht.Application.Run "arb20graph"

> 'Set myXL = GetObject("R:\website\w3website\arb20\chart.xls")
> 'myXL.Application.Visible = True
> 'myXL.Parent.Windows(1).Visible = True

> 'myXL.Application.run "arb20graph"

> End Sub

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Wed, 18 Jun 1902 08:00:00 GMT  
 Run-Time Error '429': ActiveX component can't create object

Quote:

>I have the following problem with microsoft Visual studio or Office 2000

>I write the following program in visual basic 6.0, try to auto run a
>macro which resides in excel 2000. However,
>it runs OK when excel 2000 is Open. When excel is closed, it will give
>an error: Run-Time Error '429': ActiveX
>component can't create object.

>I try to uninstall or reinstall office 2000, it does not solve the
>problem. I suspect something is missing in my
>windows 2000(However, I just resintall windows 2000 and everything seems
>fine), or something is wrong with the
>activeX server. Could anyone have any idea what is wrong with that?

>Thanks in advance.

>Sub main()
>Dim myXL As Object
>Dim sht

>Set sht = CreateObject("Excel.Sheet")
>Set sht = GetObject("R:\website\w3website\arb20\chart.xls")
>sht.Application.Visible = True
>sht.Parent.Windows(1).Visible = True
>sht.Application.Run "arb20graph"

>'Set myXL = GetObject("R:\website\w3website\arb20\chart.xls")
>'myXL.Application.Visible = True
>'myXL.Parent.Windows(1).Visible = True

>'myXL.Application.run "arb20graph"

>End Sub

For your information.

INFO: Troubleshooting Error 429 When Automating Office Applications
Run-time error '429': ActiveX component can't create object.
This error occurs when the requested Automation object could not be created
by COM, and is therefore unavailable to Visual Basic. The error is typically
seen on certain computers but not others. This article provides some
troubleshooting tips to help you diagnose and resolve common problems that
are known to cause this error.
* http://support.microsoft.com/support/kb/articles/q244/2/64.asp

Henri Leboeuf
Web page: http://www.generation.net/~hleboeuf/index.htm



Wed, 18 Jun 1902 08:00:00 GMT  
 Run-Time Error '429': ActiveX component can't create object
Everytime I have seen this problem it has been due to a missing or
unregistered dll file. Dunno maybe your scripting dll files are not
registered properly

Smac.


Quote:
> I have the following problem with microsoft Visual studio or Office 2000

> I write the following program in visual basic 6.0, try to auto run a
> macro which resides in excel 2000. However,
> it runs OK when excel 2000 is Open. When excel is closed, it will give
> an error: Run-Time Error '429': ActiveX
> component can't create object.

> I try to uninstall or reinstall office 2000, it does not solve the
> problem. I suspect something is missing in my
> windows 2000(However, I just resintall windows 2000 and everything seems
> fine), or something is wrong with the
> activeX server. Could anyone have any idea what is wrong with that?

> Thanks in advance.

> Sub main()
> Dim myXL As Object
> Dim sht

> Set sht = CreateObject("Excel.Sheet")
> Set sht = GetObject("R:\website\w3website\arb20\chart.xls")
> sht.Application.Visible = True
> sht.Parent.Windows(1).Visible = True
> sht.Application.Run "arb20graph"

> 'Set myXL = GetObject("R:\website\w3website\arb20\chart.xls")
> 'myXL.Application.Visible = True
> 'myXL.Parent.Windows(1).Visible = True

> 'myXL.Application.run "arb20graph"

> End Sub

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

2. Run time error '429': ActiveX component can't create object

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

4. Run time error '429': ActiveX component can't create object

5. Run-Time Error '429': ActiveX component can't create object

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

7. Run time error 429 ActiveX Component can't create object

8. Run time error 429: Activex component can't create object

9. Runtime error '429', ActiveX can't create object

10. Run Time Error 429: Active-X component can't create object

11. Run-time Error 429 (ActiveX can't create object)

12. ActiveX component can't create object or return reference to this object (Error 429)

 

 
Powered by phpBB® Forum Software