LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel ActiveX: Server Execution Failed Error

I'm using my own ActiveX VIs to control Excel. I take a text file and create a chart from some of the columns, then print the chart. I'm getting a "server execution failed" error when I call PrintOut on the chart object. I understand this error stems from the fact that I'm developing on Excel 2007 and testing on 2003, but upgrading all of the computers that will use this software is not going to happen.

I've fixed all other incompatibilities between versions, and the chart is created correctly, but when the PrintOut method is reached, I get the error. Has anyone ran into this and worked around it? Is my only solution to downgrade my machine to Office 2003?
0 Kudos
Message 1 of 8
(3,957 Views)
There aren't that many workarounds when you're dealing with ActiveX. If you know for sure that your code works on a machine that has Office 2003, then one thing you can try (aside from using a separate machine for development) is to create a virtual machine on your computer just for this kind of testing. The virtual machine would have LabVIEW and Office 2003 installed on it, so you can leave Office 2007 installed on your computer.
0 Kudos
Message 2 of 8
(3,944 Views)
When the specific details of an activeX call prevent the compatibilty between versions, sometimes the standardized interface of the GUI are helpful.  In this case I suggest trying the Application.SendKeys method to send "^P[ENTER}" to the Excel interface.  Excel must be the active window.  Set the wait to TRUE to suspend other operations until the printout has been sent.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 3 of 8
(3,913 Views)

Hey Marc,

 

Did you ever resolve this issue?  I'm running into the same exact issue on a current project:  calling the PrintOut method works fine on my machine, but when running it on a 2003 machine it returns 'Server execution failed' error.

 

The strange thing is, it works from the development environment on the 2003 machine, it only returns the error when running from an executable.

 

Anybody else experience similar issues with MS office automation/ActiveX?

 

thanks,

Quintin

0 Kudos
Message 4 of 8
(3,205 Views)

Hi Quintin,

 

When you get the 'server execution failed' error, is there an error number associated with it? Also, if you're only experiencing the problem when the program is deployed as an executable, try the following workaround for the VI in question:

 

In LabVIEW select File>>VI Properties. Select Execution from the category box and set the Preffered Execution to user interface. 

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 5 of 8
(3,192 Views)

The error code returned is:  -2146959355.  I'll give the work around you suggest a try.

 

thanks!

0 Kudos
Message 6 of 8
(3,177 Views)

Here's a few details on that particular error, both of these articles have some workarounds:

 

Error -2146959355 When Using ActiveX or the Report Generation Toolkit

 

Error 2146959355 When Running Exe on Machine With Different Version of Office

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 7 of 8
(3,163 Views)

I ended up getting a chance to build the executable on my client's machine, where we were having the issue, and the newly built executable worked error free.

Message 8 of 8
(3,147 Views)