LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 97 using an executable and Excel

Solved!
Go to solution

Hello,

 

I have a program that writes samples periodically to an Excel file ( a specific one), the program is working fine when i run it from LabVIEW, but when i try to do the same with an executable built with the Report Generation Toolkit it opens Excel for a while without any sheet then the file is closed and the executable generates the following error: Error 97 "Unknown System Error dans Set Cell Value.vi->test.vi", can someone please tell me what causes this error and how to fix it ? Thank you.

 

In attached files you'll find a view of the Set Cell Value and its location on the main program.

 

I use LabVIEW 8.6 and Excel 2007.

 

MGarry

Download All
0 Kudos
Message 1 of 13
(5,642 Views)

I'm using the same PC (Windows 7) with  the same softwares as an admin user no updating for ActiveX was made since the executable was built, i have made lot of searches on the NI Forums and all i found was about error 97 on the VIs, exactly "A null or previously deleted refnum was passed in as an input" yet my VI works fine and the .exe does not, i don't really see where the problem may come from ? If you do please show me how to proceed to solve this.

 

Thank you,

 

MGarry

0 Kudos
Message 2 of 13
(5,621 Views)

I used LabVIEW 2011 instead of 8.6 to build the .exe and still have the same problem, the VI is working the .exe is not !!!

0 Kudos
Message 3 of 13
(5,606 Views)

Hi MGarry,

 

This error specifically can come up when the executable is unable to find the custom ActiveX automation that it is linked to. For example if an OCX file is missing, incorrectly located or has a duplicate located in another directory, the link might be bad. An OCX file, short for OLE Customer Control,  is an independent program module that can be accessed by other programs in a Windows environment. OCX controls represent Microsoft's second generation of control architecture. Make sure that your ActiveX OLE's are linked to the System32 folder properly. Recompile your code and it should work.

 

Let me know if this works. 




Ryan
Applications Engineer
National Instruments
Message 4 of 13
(5,591 Views)

You should also take a look at this resource.

 

 

http://digital.ni.com/public.nsf/allkb/FD7DE8BC8FFC256C862565F4006BE363

 

When building an executable you need to use the "strip path" function twice rather than once as is the case in a VI. After inserting a second strip path to the executable the application was able to locate the excel file and read the cell.

Ryan
Applications Engineer
National Instruments
Message 5 of 13
(5,580 Views)

Hello Ryan-AE,

 

Thanks for the reply, as recommended in your second post i have used "strip path" function twice in my code and nothing has changed so i replaced the "Current VI's path" function by the absolute path of my Excel file (constant) and it did work, the problem now is when i press stop button and instead of closing and saving the Excel file ( as in developement system) the .exe returns the following error :

 

"error -2146827284 : Exception occured in Microsoft Office Excel: Microsoft Office Excel ne peut accéder au fichier « C:\builds\testproject\My Application excel\Applicationexcel.exe\765AA000 ». Plusieurs raisons possibles :

• Le nom du fichier ou le chemin n'existe pas.
• Ce fichier est actuellement utilisé par un autre programme.
• Le classeur que vous essayez d'enregistrer porte le même nom qu'un classeur actuellement ouvert.Help Path is C:\Program Files\Microsoft Office\Office12\1036\XLMAIN11.CHM and context 0 dans test.vi"

 

I'm trying to figure out what can make this error appear, any help will be appreciated.

 

See attached files for more detail.

 

MGarry

 

 

Download All
0 Kudos
Message 6 of 13
(5,568 Views)

HI.

I had the same error but not with executables, and what happened was that there was some program on my computer, they could not allow to work with "Excel", this problem is solved by stopping the process "EXCEL.EXE" manually in "windows task Manager" ---> Ctrl-Alt-Sup. And running the application again.



Ing. Jonathan E. Cruz Ortiz

ENERGÍA PROACTIVA S.A.S

Cel : (+57) 3173669343 - (+57) 3124451894

0 Kudos
Message 7 of 13
(5,550 Views)

Hi,

 

Even with "EXCEL.EXE" closed it still giving me the same error -2146827284.

0 Kudos
Message 8 of 13
(5,541 Views)

Do you have it programed to stop your program, save the file, clear the buffers and then close out or do you just hit the abort button?

Ryan
Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(5,521 Views)

Hi,

 

I had a similar problem about a year ago when my laptop was upgraded to windows 7. I found that 1 or 2 of the Excel Active X controls were broken. I had to open them, and relink to the Active X controls.

 

My error # was different and it happened after an upgrade.

 

Maybe one of your Excel Active X controls has become corrupted, even though you have not done an update. You could open all the Excel Active X controls and relink to them or try re-installing the Report generation Toolkit.

 

Just my wild guess. I hope it helps.

 

Good Luck

 

Ken M

Smiley Happy

 

Message 10 of 13
(5,517 Views)