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: 

How can I set Excel Data In LabVIEW

Hi,

 

There is an example about  how to use LabVIEW and ActiveX to programmatically read in Excel data. It uses Range and then by reading Value2 it is possible to read excel values in that range in a specific sheet.

 

http://www.ni.com/example/28409/en/

 

Now I would like to write data ( 2D string ) to specific excel sheet. Could you please let me know if there is a way to modify this code to use it for writing to Excel instead of reading

 

I actually would like to write 2D data to specific sheet of an Excel form. The Read_Excel_Values.llb works perfect for opening an Excel file, specify a sheet and then read the data but I would like to write instead of read.

 

Thanks 

0 Kudos
Message 1 of 8
(3,275 Views)
What is your problem with just using the Write to Spreadsheet File? The latest version of LabVIEW and the Write to Measurement File supports direct to excel format. Did you look at the example that comes with LabVIEW?
0 Kudos
Message 2 of 8
(3,261 Views)

Could you plz let me know how can I write to a specific Excel sheet using Write to Spreadsheet File?

0 Kudos
Message 3 of 8
(3,244 Views)
You can't directly but you can open excel and then import to a specific sheet.

Do you have the report generation toolkit? Have you looked at the shipping example? Have you looked at the examples in the excel board?
0 Kudos
Message 4 of 8
(3,239 Views)

There are few examples in the Excel forum but I still couldn't fine any example to write to specific Excel sheet. 

0 Kudos
Message 5 of 8
(3,217 Views)
The excel properties such as active sheet are all documented in excel.
0 Kudos
Message 6 of 8
(3,204 Views)

Hi Tintin,

Please find the attached VI where i tried to write a 2d array using activeX functions to an excel sheet.

 

 

Regards,

Srikrishna.J

 WriteExcel_Activex_BD.png

Regards,
Srikrishna


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

If you have the Report Generation Toolkit, there are some Excel specific functions for writing values into cells of a workbook.

Capture.JPG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 8
(3,141 Views)