+ Reply to Thread
Results 1 to 16 of 16

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

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Hi,
    I am trying to generate excel report output from access by click of a button. Part of the code is as follows:
    Dim lngColumn As Long
    Dim xlx As Object, xlw As Object, xlc As Object
    Dim DBS As DAO.Database
    Dim rst As DAO.Recordset
    Dim blnEXCEL As Boolean, blnHeaderRow As Boolean

    blnEXCEL = False

    'If we do not want the first row we set Header to false
    blnHeaderRow = False

    'Establish an EXCEL application object
    On Error Resume Next
    Set xlx = GetObject(, "Excel.Application")

    If Err.Number <> 0 Then
    Set xlx = CreateObject("Excel.Application")
    blnEXCEL = True
    End If
    Err.Clear

    I worked on development on a server and worked fine. However when I have moved the code and database to the desktop of mine I am having
    the following error in the line

    Set xlx = GetObject(, "Excel.Application")
    I cannot figure out how to fix this. I appreciate any help for resolution. Thanks.


    Run-time error '429'
    ActiveX component can't create object
    Last edited by gamaz; 01-26-2010 at 07:04 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,968

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

    In the VBEditor, under Tools-Options on the General tab, do you have Break on all errors set?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

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

    gamaz, please edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Thanks romperstomper for the help. However I am using Access vba as front end. I did not find the Break on all errors in the option on the general tab.

  5. #5
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Sorry shg I forgot. I just put the code tag there.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,968

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

    Are you looking in the VBEditor, or in the main Access window? It needs to be the VB Editor.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

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

    Hello gamaz,

    This is because the statement GetObject(, "Excel.Application") is trying to attach to a running instance of Excel. If you change the call to include an empty string for the PathName (first argument) then it will create an instance if a running instance can't be found.
       GetObject("", "Excel.Application")
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Yes I see it now.

  9. #9
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Break on all errors in

  10. #10
    Registered User
    Join Date
    07-15-2009
    Location
    Rockford, IL
    MS-Off Ver
    Excel 2003
    Posts
    38

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

    Changing the option to Break on Unhandled Error did solve the problem. I am also going to try the solution suggested by you. Thanks Leith.
    Thanks romberstomper for pointing out the location to fix the error.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

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

    gamaz: Please change the QUOTE tags to CODE tags.

  12. #12
    Registered User
    Join Date
    04-06-2011
    Location
    Bath, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    FirstBlankCell Error

    Hi

    I have the following macro to find the last blank cell in a column range, and enter data.

    It used to work fine, but now returns the error:

    'Application-defined or object-defined error'

    Sub SETTest()
    '
    ' SETTest Macro
    ' Macro recorded 23/03/2010 by Richard Fisher
    '
    ActiveSheet.Unprotect

    Dim FirstBlankCell As Range
    Set FirstBlankCell = Range("A1:A10").End(xlDown).Offset(1, 0)
    FirstBlankCell = Range("B1")

    ActiveSheet.Protect
    End Sub

    I've researched and found that the syntax is correct and it worked a year ago, so I'm totally flummoxed!

    Any ideas?

    Kind regards,

    Richard Fisher
    richard@granddeckdesigns.com

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,968

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

    Hi, and welcome to the forum.

    Unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

    Please note you should also enclose all code in code tags.

    Thanks.

  14. #14
    Registered User
    Join Date
    12-27-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    3

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

    Hello Leith Ross,

    I also had the same problem (GetObject) not working. It worked fine on Excel 2003 but when moving to a laptop with Excel 2007 it did not work, however using your empty string suggestion solved the problem. Thanks, Keith.

  15. #15
    Registered User
    Join Date
    12-27-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    3

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

    Hi Again,

    Well, after further testing the solution did not work as I expected, so I summarise as follows:-

    Set XlApp = GetObject(, "Excel.Application")
    works in 2003, i.e. it just fetches the existing running excel object and does not open any new object (exactly the behaviour I was looking for. This however does not work in 2007 version, instead the error code 429 is returned.

    Set XlApp = GetObject("", "Excel.Application")
    as suggested by Leith above solves the Error 429, but the behaviour now is to open a new Excel application. Originally I though this had worked because it returned object, and i saw no new Excel Application running, however this was because it was not visible. I only detected it because the xlApp.Workbooks.Count call was returning 0 open workbooks when clearly there was a workbook open in the visible application.

    Finally however I got it working in 2007, the correct code to use is:
    Set XlApp = GetObject(Class:="Excel.Application")
    with this format, no new object is created, and instead the existing application is returned and the existing workbook is found...

    /k

  16. #16
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,920

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

    @KeithDyne
    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies. Did you read post #13?
    Last edited by protonLeah; 12-29-2012 at 10:27 PM.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1