LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to .xlsm file and executing Excel-macros using ActiveX (Microsoft 365)

Hi,

I am looking for a way to write data into an .xlsm file (not .csv or similar but a  native excel file!) and to execute macros inside that file in Office16 (I have a Microsoft Office 365 license). I am using Labview 2019 SP1 32 Bit. The functions provided in the example file C:\Program Files (x86)\National Instruments\LabVIEW 2019\examples\Connectivity\Excel (see attached files) offer all the functions I need. However if I try to run these examples I get an error "connected two terminals of different types ... source is invalid". Also properties and methods are not accessible.

fbuchmaier_1-1638358476296.png

I tried fixing it by choosing the right Excel Object Library in the ActiveX-reference constant. To do that I followed this manual: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KZNSA2&l=de-DE

fbuchmaier_2-1638359860280.png

But I do not achieve the results shown in step 5. After choosing C:\Program Files\Microsoft Office\root\Office16\EXCEL.exe to link Labview to the right Object library for my Excel-Version the following Object library is selected:

fbuchmaier_4-1638360417278.png

The  Application (Excel.Application.16) option I need to access the Excel-Application is not available. from looking into the registry I know there should be another Object library (16.0) but it is not choosable in Labview.

fbuchmaier_6-1638362848196.pngfbuchmaier_7-1638362899081.png

Is there a way to get the attached example VIs working for Office 365? Or alternatively is there a solution that offers the same functions as the example VIs but uses the Excel 5.0 Object Library that is auto-selected when choosing the EXCEL.exe file as described above. Using the report generation toolkit is not an alternative because it is apparently not compatible with Office 365.

 

Thanks for any kind of help in advance

 

 

 

 

Download All
0 Kudos
Message 1 of 1
(990 Views)