LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel API

Solved!
Go to solution

Hi Masters,its be my first try with excel api and i want create or Edite excell file by this. I used the automation refnum and select activeX:  microsoft excel 16 object library,and maked Excel.Application.now,i tried use property and inovke node to create or select file but i don't know to select method for this,i try most of them but i didn't run this procces.This picture is selected activeX and i think after this most be used property and invoke,Yes? 

Thank you All and Sorry for my bad english  

This picture is selected activeX and 

AmirK_0-1692273078775.png

 

0 Kudos
Message 1 of 5
(595 Views)

If you want to "program Excel", learn VBA and program in Excel.  If you want to program in LabVIEW and use Excel (i.e. store LabVIEW data in Excel WorkBooks/WorkSheets, and use LabVIEW to "do computations" from data that come from Excel WorkBooks), install the Report Generation Toolkit and do "fairly high level" VIs to get the Excel data into LabVIEW, where you can manipulate it, and get the LabVIEW data back into Excel.  Note that this may be an additional license, but well worth it (in my opinion).

 

Bob Schor

0 Kudos
Message 2 of 5
(576 Views)
Solution
Accepted by topic author Amir.K

If you want to make an Excel API yourself (for learning purposes or because the report generation toolkit 'has issues'), I'd go for MS's Open Office XML .NET library.

0 Kudos
Message 3 of 5
(556 Views)
Solution
Accepted by topic author Amir.K

 

Fine my responses on the below thread on how to select the ActiveX-Excel Application and accessing Excel Basic Functions. 

 

https://forums.ni.com/t5/LabVIEW/Excel-ActiveX/m-p/4186866#M1210930.

 

https://forums.ni.com/t5/LabVIEW/Excel-Worksheet-delete/m-p/4013077?lightbox-message-images-4013042=... 

 

Once done you have to use Methods to access the Excel Application and Properties for Accessing Values.

 

To Automate, Manually access the Excel Application and try to find the relevant functions for automation using ActiveX.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 4 of 5
(543 Views)

@PalanivelThiruvenkadam wrote:

Once done you have to use Methods to access the Excel Application and Properties for Accessing Values.


And once you build an executable, it will fail if there's any difference in the Excel AX version. When IT upgrades Excel, exe needs a rebuild... It's LV's early binding to AX that causes this.

 

This has always been the RGT's problem, and AFAIK, has not been fixed..

 

MS has a .NET wrapper (Microsoft Office Object Library* IIRC, that use late binding) around AX. It still has a little bit of the problem as at some point the AX API changed, but everything beyond an (older) version works with one compile. IIRC, it opens the AX and returns the reference, so everything after the open is the same.

 

* Microsoft.Office.Interop.Excel, ApplicationClass could be the start...

Message 5 of 5
(96 Views)