LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

check for excel installation

Hi All,

 

Is there a way to check to see if Ms Excel is already installed on a given system?  And is there a way to check for the current version of Excel?  I'm running LV 8.6 w. Report Generation toolkit.

Message Edited by lavalava on 06-17-2010 03:16 PM
Message 1 of 4
(3,653 Views)

Automation Open will return error -2147221164 if excel is not installed

 

To get the version, use a property node to get the the Version property on the Excel._Application ref (the ref returned by the Automation Open call).  I'm not sure of the correlation between version numbers and excel naming schemes, but i know that versions 11 and earlier and pre-Excel 2007.

 

Note that if you are using pre-2007 Excel, you should not save with a .xlsx extension or vice versa. neither old or new excel will know what to do with the file.

 

Whenever you have Excel issues, I recommend going to http://msdn.microsoft.com and searching for the function or idea you are having trouble with. You'll usually get some really good text programming examples that will get you where you need to go.

Message 2 of 4
(3,637 Views)
You can also simply check the registry. Look at the HKCR\Excel.Application.CurVer\(Default) key. The value (if it exists) will tell you the version number. For example, a value of Excel.Application.11 indicates Excel 2003. You can Google for the various values for the different versions of Excel.
0 Kudos
Message 3 of 4
(3,621 Views)

I tried this, using:

 Wrong Excel._Application.png

And picked "_Application".  I always got Error 3005 (Automation Open: Object specified is not creatable), even on a computer with Excel installed.

 

I went back to select "Select ActiveX Class...", and switched on the "Show Creatable Objects Only" (very important).  Now, "_Application" disappeared, but "Application (Excel.Application.16)" shows up.  Using "Application..." works great.

 

By the way, these tools are on the Connectivity/ActiveX pallette.

 

 I had also tried a .NET call, configured with Assembly="Microsoft.Office.Interop.Excel(15.0.0.0)", instantiating "ApplicationClass".  That works great on a computer with Excel installed.  But if I try to open the .vi on a development system without Excel, it has to search for (and can't find) Microsoft.Office.Interop.Excel.dll.  And my particular use-case is for development environment only.

 

 

___________________
CLD, CPI; User since rev 8.6.
Message 4 of 4
(2,886 Views)