Solved

Automation Error

Posted on 2002-07-03
11
378 Views
Last Modified: 2007-12-19
Hello

Someone gave me a working VB5 prog that had been compiled and worked fine.

I had to add a few lines to it, and so mirrored it on a working machine to add the code and then test it. The test worked fine.

The altered programme was then moved to the "live" location and run from there. An error message "Automation Error" and a long (smthg like -2120000456") displayed. So it failed. The added code was just vanilla variable processing, in a few loops. How come it runs on the test machine, but not on the live location, and what is and what is causing the Automation Error.

Urgent answer would be great. Thanks.
0
Comment
Question by:afterburner
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 2

Expert Comment

by:chops123
ID: 7126672
Can you paste the exact error.

What does the program do ?

KC
0
 

Author Comment

by:afterburner
ID: 7126721
>Can you paste the exact error.

Well the EXACT error is not to hand at the moment in terms of the number that is returned, but I assume by the way you ahve asked the question that this is relevant. The nearest I can get at the moment is "Automation Error - -212xxxxxxx", and I am saying that if the "xxxxx" part of that is relevant to you then I will have to go run the prog again. Let me know.

>What does the program do ?

That is a long story for sure, sorry to say. Essentailly it's a parser.

KC
0
 
LVL 6

Expert Comment

by:marconovaro
ID: 7126753

The "xxxx" part is for sure relevant. This should help to find the meaning of the error, and so to resolve it.
You can have a look to:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q186063

to know how to "translate" this error.
Let me know...
0
 
LVL 2

Expert Comment

by:chops123
ID: 7126756
Well why I asked was because it needs to be known if the error is a trappable error or not. Automation error can occur due to various reasons. The error number you specified is not a trappable error. so you wont find any documentation on it as well.

The cause of automation errors are usually due to version compatibility in active-x components on different machines.

What are the active-x components being referenced in your application.

KC
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7127000
have you re-register the DLL?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:afterburner
ID: 7127077
Guys

The actual error is:

QUOTE

Run Time Error
-2147024894 (80070002)
Automation Error

UNQUOTE

The ocx's etc being reffd are:
MSCOMCTL.OCX
COMDLG32.OCX
COMCT232.OCX
MSCAL.OCX
 and
WSHOM.OCX
MSSCRIPT.OCX

all of them have the same version number as the controls used on the original machine used for compiling, EXCEPT for the last one - MSSCRIPT.OCX. The original machine version is earlier than the one I compiled with.

So ... I tried getting the earlier one across of course. But I cant copy anything into my WINNT System32 directory. Even when I switch all security to full for the directory, copying a file to it simply bounces back to the old one.

0
 
LVL 44

Expert Comment

by:bruintje
ID: 7127590
you can try an unreg with

-close all programs running
-regsvr32 /u c:\path\dll
-then rename the newer one
-then paste the older one
-do a regsvr32 for the older one

:O)Bruintje
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7127603
and don't forget a reboot after the register action
0
 
LVL 2

Accepted Solution

by:
chops123 earned 100 total points
ID: 7127716
According to MSDN,Run Time Error -2147024894 (80070002)Automation Error indicates that "The System cannot find the specified file". This implies that one of the DLL that you are referencing may not be present on the machine that it is running on.

Why dont you debug the program on the machine where you are getting the error.Since you mentioned that MSCRIPT.OCX (Micrsoft Script Control) has some version issues,you can try replacing the same by the newer one available on the other machine.Do not delete the old DLL,simply rename it first.In case the DLL is being used by some other process,restart the machine and then follow the procedure mentioned above.Register the DLL again and try.

Regards
KC

0
 

Author Comment

by:afterburner
ID: 7130071
Guys

The automation error in this case meant that it couldnt find a whole app that the prog was calling through a shell, since the path to it was wrong.

The main contribution that helped me wth this was

>> ........ indicates that "The System cannot find the specified file".

So thanks chops123!!
0
 

Author Comment

by:afterburner
ID: 7130072
Good stuff.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now