From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Server execution failed error

Hi,
I am running Labview 7.0. I have written some code that opens an excel file and reads from it. I created an executable of this code, and when I tried running it on another machine with LabVIEW RTE installed, I get an error saying 'Error -2146959355 occurred at Server execution failed in .vi -> .vi'. The error happens the moment the code tries to open the excel file. However, execution does not stop at this point; it just goes on until it reaches the end of the code.
I use ActiveX controls to communicate with excel. The code works on the development machine in development mode. I'm wondering if I have to dynamically include some file when I create the executable.
Any help would be appreciated.
Thanks,
-Sid
0 Kudos
Message 1 of 6
(2,866 Views)
Most likely, you're looking at a path problem to the Excel file from the applicaiton.

When you build a VI into an applicaiton, the path to that applicaiton changes. If originally the VI that calls the Excel file was located "c:\app\caller.vi", after you build the executable, that same VI will now be located at "c:\app\toplevelVI.exe\caller.vi".

The executables name will now actually be a part of the path. So you may need to add an extra "Strip Path" function somewhere to get you to the real path to the Excel file. Of course this is just a guess without seeing your code. You could try going back to the LabVIEW code and add a path indicator where you are building the path, then re-build the application and run it so you can see what the path is after it's built.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 6
(2,860 Views)
Hi Ed,
I am passing in the file path as a control. However, I did put in an indicator and it showed me the right path to the file. Before I open the file, I am opening Excel and making it visible. This seems to work alright.
I installed Labview on the machine where I'm running the executable and copied the code on to this machine. The same error now occurs in development mode. However, the error does not occur on the machine where I developed the code originally.
Thanks,
-Sid
0 Kudos
Message 3 of 6
(2,856 Views)
Another to check is versions of Excel between the two machines.

I've had problems using ActiveX with Excel when the versions we not the same. One time it was actually the same major version (Excel 2002) but the deployment machine had Excel Service Pack 1 installed and my development machine had SP3. The service packs can change the ActiveX components enough that they are not compatible. Check the "About" dialog in Excel on both and see if they match. If not, upgrade one or the other and see if that takes care of it.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 6
(2,847 Views)
Hi Sid,

This error is expected if you are having a different version of Microsoft Excel on the distributed machine than on the development machine. Please see the following KnowledgeBase:

Error 2146959355 When Running Exe on Machine With Different Version of Office
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 5 of 6
(2,834 Views)
Hi,
The version of office was indeed the issue that was causing the problem. Thanks a lot guys.
-Sid
0 Kudos
Message 6 of 6
(2,823 Views)