Example Code

Add and rename MS Excel worksheets

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

 

Overview
The following code illustrates how to programmatically add and rename several worksheets on an Excel workbook using the NI LabVIEW Report Generation Toolkit for LabVIEW.


Description
The following code illustrates how to programmatically add and rename several worksheets on an Excel workbook using the NI LabVIEW Report Generation Toolkit for LabVIEW. This is useful in situations where more than 4,000 rows or columns need to be attached to the document. If trying to attach more than 4,000 elements, LabVIEW generates error code -41114. Also is useful if you want to programmatically add and rename worksheets for a better distribution as long as data keeps increasing.


Requirements

  • LabVIEW 2012 (or compatible)
  • NI LabVIEW Report Generation Toolkit


Steps to Implement or Execute Code

 

  1. Download the attachments that fits your LabVIEW version.
  2. Write a File Name and a Worksheet Index Name.
  3. Run the VI
  4. Click on the Generate Data button. Each time you click it, 3 colums with 4,000 rows will be created and attached to File.
  5. Stop the VI.
  6. Open the file that will be saved (if prompted to) on your Desktop.

 

Additional Information or References
VI Block Diagram

 1.png

 

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

 

 

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte

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

Comments
sdgsdg
Member
Member
on

Is it already exsisted in Labview Generate Report Pallet?