+ Reply to Thread
Results 1 to 6 of 6

Run-time error '429' - VBA code help

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Run-time error '429' - VBA code help

    Hi all. I am getting "Run-time error '429': ActiveX component can't create object" error on the following line of this code 'Set LoopListWS = ThisWorkbook.Worksheets("Argus Macro")'


    Please Login or Register  to view this content.
    I checked for missing references but there are not any. Also, I have an older file with the same code that still works...
    pls click the star if you liked my answer!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Run-time error '429' - VBA code help


    Hi,

    rather than an useless Worksheet variable why not directly use the worksheet CodeName ?!

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Run-time error '429' - VBA code help

    Thanks for the reply! What does "worksheet CodeName" mean?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Run-time error '429' - VBA code help


    When the worksheet belongs to the workbook containing the VBA procedure so the worksheet property CodeName - like a Worksheet variable -
    can be used, no changes when the worksheet is renamed like you can see on VBE side
    for example Sheet1 (Data) where Data is the Name and Sheet1 the CodeName
    then rather than Worksheets("Data").Range("A1:B9") you can directly use Sheet1.Range("A1:B9")
    very usefull when an user renames the worksheet Data to Ledger for example …

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,924

    Re: Run-time error '429' - VBA code help

    I'm doubtful that it is that line which is causing an automation error. If the worksheet didn't exist you'd more likely expect an error #9.

    Are you able to share a workbook?

  6. #6
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Run-time error '429' - VBA code help

    I was able to just remove "Thisworkbook" from the code and use this line instead:

    Please Login or Register  to view this content.
    That seemed to work for some reason.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error Handling: Need simple code for Run-time Error
    By romsky26 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2021, 08:59 AM
  2. Error code "run time error 9: subscript out of range
    By iBennett93 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-28-2021, 05:03 AM
  3. [SOLVED] Why am I Getting a Run-time Error '91' error after adding CurrentUser to code below?
    By gmr4evr1 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-14-2015, 06:24 PM
  4. Need to add if error code to worksheet change event to stop a run-time error
    By KT99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2014, 03:10 PM
  5. vba code throws an error first time but runs perfectly the second time. HELP!!
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2014, 12:42 PM
  6. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  7. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM

Tags for this Thread

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