Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automation error

Status
Not open for further replies.

taupirho

Programmer
Jun 25, 2002
680
GB
Hi ,I'm developing an excel 97 vba app. I have hit a problem when deploying it or other machines. I now get the error message " Automation Error" "Compile error" and debugger stops on following line:-

set dbcomboreg = NEW connection

Sometimes the error is "Invalid data" and debugger stops on same line. Also get the same messages on my worksheet_beforeclose event where I have the following lines:-

set userform1=nothing
set userform2=nothing
set userform3=nothing
set userform4=nothing
set userform5=nothing
set userform6=nothing

Debuuger complains about the fourth line above only! Comment it out and it skips through the rest no problem.

The app works fine on the machine it was created/maintained on, just has problems on other machines and only since yesterday. Other machines are running same O/S and office versions of developer machine. Also none of the above code has been touched in weeks. This has only been a problem since yesterday. Any ideas
 
Hi Tom,

Maybe you are referencing some libraries which can not be found on the other PC (If it has been rebuilt yesterday or something like that). Check the tools/references and see if anything is missing. Also, does the userform on which it gives the error hold a different kind of control than the other ones?

Nath
 
I have noticed that the activex data object 2.0 library file on the development PC points to MSADO15.DLL and on the target machine it is MSADO20.TLB !!. If on the target machine references I do a find for MSADO15.DLL it references it as MS activeX data objects 2.6 library.

How do I get these back into synch again.
 
I'm a bit confused. On my machine MSADO20.TLB is Version 2.0 of ADO Library and MSADO15.DLL is 2.1; but you say that
MSADO15.DLL is 2.0 on the development PC?

Also if your target machine has MSADO15.DLL it should point to it even if it is a newer version, and it shouldn't create any problem (backward compatibility).

I'm not sure how to get them back in line. Maybe you should check with your windows administrator what has been changed.

Keep also in mind that it might have absolutely nothing to do with it.

Another thought, you should try to declare and set your ADO objects with the library name (ADODB) :

Code:
set dbcomboreg = NEW ADODB.connection

It is a long shot but it can't hurt to do it that way.

Good luck,

Nath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top