Click here to Skip to main content
15,843,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good evening, World !!. I'm working with an old Access 2010 application, and I'm getting an error message 429 "Activex cannot create the object".

The reference to the library is correctly registered in the references list of the project, and the file (a .TLB file) is now properly registered in windows 7. I thought doing that was enough to solve ths problem, but it still remains the same; that´s why I resort this forum (I hope is correct to say so).

I used to work a lot with VB 6 and found this problem a lot of time, but it was never this difficult to me to solve it. I have to admit my lack of experience with access.

The dll is one that a vendor gave us recently, I don´t know if it's developed in the same version of Access or what, so it could be a compatibility issue. My problem is that my bosses don´t want to deal with this vendor anymore, they had to take a legal action even to get this final component, so I have to solve this.

Here's a piece of code:

VB
Dim objProd as new ProductoTemporal ("ProductoTemporal" is a class contained in a registered DLL)
Dim Cadena as string


After the dim´s, if I put the cursor above "objProd" it shows

Quote:
"Object variable or statement width not stablished"; "Cadena" has a value ""


When the code tryes to assign a value to one property (Conexion):

VB
objProd.Conexion = Cadena  (The string variable already have the proper string connecction)


here´s when the program fails.

I would really appreciate anyone's help.

What I have tried:

I'm even trying to change the code, but it has take me a lot of time.
Posted
Updated 10-Jan-18 10:18am
v3
Comments
Maciej Los 10-Jan-18 13:53pm    
Have you debug your VBA programme to find out where the error occurs?
Miguel Altamirano Morales 10-Jan-18 14:21pm    
Thanks for answerig, Maciej. Yes I have done this. I have perfectly identified where. The code fails here:

objProd.Conexion = Cadena

Giving me the error number 429 "The Activex component cannot create the object".

This code is after the "Dim" statements I described in my question.

I wonder if Access needs some configuration in order to be able to create objects.
Maciej Los 10-Jan-18 14:29pm    
Have you added a reference to that dll in a Tools->References window?
Miguel Altamirano Morales 10-Jan-18 14:32pm    
yes, everything seems to be in order.
Miguel Altamirano Morales 10-Jan-18 14:35pm    
I even can see it in the Object Browser, with all its members

1 solution

Take a look here: ActiveX component can't create object or return reference to this object (Error 429)[^]
There you'll find the most common reasons of above error.


[EDIT]
Before you start changing anything, please, read this:
How to check and remove incorrect project references in the Visual Basic Editor in Word[^] - it's not important that this topic concerns MS Word, VBA editor is the same
Check or Add an Object Library Reference[^]


Try to change your code into below form to find out what happend.
VB
'this should be declared on the beggining of module
Option Explicit

'your soubroutine
Sub CheckMyObject

Dim objProd as ProductoTemporal

On Error Goto Err_CheckMyObject

Set objProd = New ProductTemporal

MsgBox "Object 'ProductTemporal' has been successfully created!", vbOkOnly, "Success!"

Exit_CheckMyObject:
    On Error Resume Next
    Set objProd = Nothing
    Exit Sub

Err_CheckMyObject:
    MsgBox Err.Description, vbExclamation, Err.Number
    Resume Exit_CheckMyObject

Exit Sub
 
Share this answer
 
v2
Comments
Miguel Altamirano Morales 10-Jan-18 17:35pm    
Thanks for this advice Maciej; the page is a really interesting one.

Well, at least for the first two entries, it seems to me that everything is correct; - Anyway: how can I verify the class is correctly registered ?

And how could I get to know if the class has a license ?

The library was developed (I think) with VBA and we do have a license to use the entire system. I do not know if the vendor gave us a new license.

And as I told you: I'm not authorized to get in touch with the vendor.
Maciej Los 11-Jan-18 2:00am    
Miguel, i'd suggest to re-register this dll in a system with Windows admin account priviledges. There's a chance that registration process will finish with success. On the other hand, try to change your code into the form i posted in updated answer.
Miguel Altamirano Morales 11-Jan-18 10:43am    
Good morning Maciej, thanks again for your advice.

I already tried it and is still failing with the same error 429 when it tries to execute the instruction "Set objProd = New ProductTemporal".

I just don´t know what is happening; the library is correctly registered as far as I can see, and the references list of the project do contain this reference.

Could it be possible a compatiblity problem with a different version of this dll ?

I asked for another PC to see if it still fails on it. I also going to apply for a new version of access (2016); I´m working with access 2010.

Maciej Los 11-Jan-18 14:52pm    
and the references list of the project do contain this reference - remove it and save changes then close database. After that open database again and add a reference to the new dll.

As to the MS Access - do not try to install new version.
Miguel Altamirano Morales 11-Jan-18 15:07pm    
The project already has a reference to the vendor´s library, but pointing to the .tlb file. We have in effect .dll file, but the reference is added to the .tlb file. I don´t know how does these files handles between them, and if I try to add a reference to the dll, it is rejected, "A reference to this file cannot be made" (or something like this).

Please forgive me if sometimes I cannot make my self clear. English is not my native language.

The project HAS a reference to this library.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900