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.

Example Code

Build 2D array and write to Excel

    Software

  • LabVIEW Report Generation Toolkit

Code and Documents

Attachment

Overview

This example builds a 2D array of random numbers and writes this data to an Excel spreadsheet.


Description

After a 2D array is created, it is transposed so that instead of two rows of data, we have two columns of data. Then, it is written to an Excel file with the Append Table to Report VI.


Requirements

LabVIEW 2010 (or compatible), Report Generation Toolkit for Microsoft Office. Hardware: none.


Steps to Implement or Execute Code:

  1. Create a 2D array of random numbers
  2. Transpose the array so that the Excel spreadsheet will have 2 columns instead of 2 rows.
  3. Create a new Excel file
  4. Append the array data as a table into the Excel file
  5. Open and display the data in a maximized window
  6. Close the report and references to it

 

Additional Information or References:

 

Build 2D array and write to Excel sn.png


**This document has been updated to meet the current required format for the NI Code Exchange.**

Justin Parker
National Instruments
Product Support Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Alexis_Campos
Member
Member
on

Very usefull, thanks!