LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Unknown Error -2147417851 when using any Excel ActiveX controls

Hi, I wrote a huge application in which one of the parts uses Excel ActiveX controls to store and retreive data.  On my development system, everything was fine, but then when I deploy into the actual system that will be running the application, the program acted weird.  After troubleshooting for a long time, I installed LabVIEW development suite on the actual system and started debugging that way.  The ActiveX controls were totally fine, and the program was able to write to / read from Excel thru the controls, but after I mixed a few algorithm problem (just wrong formulas, etc...), whenever the program calls an ActiveX controls (not sure if it's only to Excel or all other application), an unknown error comes up.  So I went back to my development system to try to run the program, and everything was fine...  The only difference I can think of between the two systems is that the development system has Office 97 and Office 2003, whereas the actual system only has Office 97, but I did go thru the program to replace all the "newer" activeX controls with Office 97 version activeX controls, so I don't think that was a problem.
 
>> error # -2147417851
>> The server threw an exception.
>> in ActiveX_for_Beginners.vi
 
 
Please help...
See-Ming

Message Edited by Elsa Fung on 04-28-2006 08:14 AM

0 Kudos
Message 1 of 7
(9,062 Views)
Hello,
 
There are a couple threads which contain useful information - I'll link to one, which links to another here:
 
Title: What is error -2147417851?
 
For sanity, does the error occur under the following conditions:
 
1. the same version of excel on both machines (development and target) 
2. copy the activeX controls from your working development machine, register them using regsvr32 <path to activeX control>, and then attempt to run your program.
 
I hope the other forum information is useful - repost if you continue to have trouble!
 
Best Regards,
 
JLS
 
 
Best,
JLS
Sixclear
0 Kudos
Message 2 of 7
(9,043 Views)
I tried to change the VI Execution property to User Interface, and that didn't work, error -2147417851 still comes up.  I did realize, the error comes up after Excel is opened (as in the picture, the error comes out from Open, but there was no error in Application.Workbooks.  I also tried to set the application to visible, and an error (I think it was a different number) would come out from Visible.
 
The link inside the link was broken, so I don't know what else to try.  I tried to search for "-2147417851" in the forum, but nothing comes up, I guess NI forum doesn't really support number search or something...
 
More information on my case:
1.  development machine has both Excel 2003 and Excel 97, but in LabVIEW I specifically use Excel Object Library 8.0 which belongs to Excel 97.  on the target machine, I only have Excel 97.  However, I tried to run a VI I created in the target machine, and it does the same thing, so I don't think it has anything to do with the 2003 and 97 differences.  But this article keeps bugging me...
 
2.  How do I know the path to the activeX control?  I tried to search for it in Windows, but couldn't find the library...
 
Thank you,
See-Ming

Message Edited by Elsa Fung on 05-02-2006 07:00 AM

0 Kudos
Message 3 of 7
(9,031 Views)

I think I found out what's wrong... I forgot to run the service release patches from Microsoft...

I actually setup another computer with Excel ActiveX about 3 months ago, and ran into the same thing... I can't believe I forgot about it already.. I guess I'm getting old..

Thank you!!

See-Ming

0 Kudos
Message 4 of 7
(9,023 Views)
Great!
 
One good thing about it is that now this information is here on the forum, so that the next person who needs the patches will know that's the problem!
 
Thanks for posting the update!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 5 of 7
(9,009 Views)
I know this is an old post....but could someone be more specific as to "the service release patches" talked about in the post above?
 
I hear that Office 2003 will throw the -2147417851 error when missing the Windows Office Service Pack 3.
 
 
 
I have a similar issue...I wrote a Windows Service which interfaces with my labVIEW code using ActiveX. I am NOT using anything from Micrsoft Office although Office 2003 is installed on the computer. The system has been running for about a year now with no updates made to the computer (other than labVIEW code). The following errors just started appearing:
-2147417851
-2147023174
 
And other errors relating to the RPC server being unavailable.
 
Any help would be appreciated,
Craig
0 Kudos
Message 6 of 7
(8,638 Views)

Hi Craig,

There are quite a few problems using ActiveX and microsoft that were fixed in the service relase patches that were provided by Microsoft. Can you elaborate a bit further as to what information you are looking for about the service release patches? In your application, are you also using Excel and Windows 2003? You also might want to check out Microsoft's website to see find out more information about which service release patches are available.

Carla

National Instruments
Applications Engineer
Message 7 of 7
(8,611 Views)