04-07-2013 08:31 AM
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
Solved! Go to Solution.
04-07-2013 12:35 PM
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
04-08-2013 04:36 AM
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 !!!
04-08-2013 12:47 PM
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.
04-08-2013 02:29 PM - edited 04-08-2013 02:29 PM
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.
04-08-2013 05:11 PM
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
04-08-2013 06:22 PM
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.
04-09-2013 05:13 AM
Hi,
Even with "EXCEL.EXE" closed it still giving me the same error -2146827284.
04-09-2013 01:45 PM
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?
04-09-2013 02:01 PM
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