Excel VBA Runtime error 429 ActiveX Component can't create object.

Anonymous
2024-04-07T11:11:52+00:00

Split from this thread.

i) i changed the code in my VBA Code as per comments,

It is working fine & select Empty cell also and I change the code for add new column as per below , it is working

Set rng = ws. Range("A2:AA" & lastRow)

ii) But I copy the full code & run , the error has come

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. HansV 462.4K Reputation points MVP Volunteer Moderator
    2024-04-07T12:59:22+00:00

    Remove the space from "ADODB. Connection" so that it reads "ADODB.Connection")

    0 comments No comments
  2. Anonymous
    2024-04-09T05:01:34+00:00

    The following error has come. after removing the space

    Image

    Image

    0 comments No comments
  3. HansV 462.4K Reputation points MVP Volunteer Moderator
    2024-04-09T09:34:02+00:00

    row.Value is a two-dimensional array. Join works only with one-dimensional arrays.

    Try this instead:

            values = "'" & Application.TextJoin("','", True, row) & "'"
    
    0 comments No comments
  4. Anonymous
    2024-04-09T09:43:45+00:00

    I am using excel version 2010 & after changing the code. The following error has come

    0 comments No comments
  5. HansV 462.4K Reputation points MVP Volunteer Moderator
    2024-04-09T10:08:41+00:00

    OK - TextJoin is not available in Excel 2010.

    Replace the values = ... line with

            Dim cel As Range
            For Each cel In Row
                values = values & "','" & cel.Value
            Next cel
            values = Mid(values, 3) & "'"
    
    0 comments No comments