![]() |
|
|
Introduction
This VI will allow the user to write data to an Excel Spreadsheet file with the ability to manipulate the formatting of the data and the particular sheet where the data will be written. In this particular example, a random array of data is written to Sheet2, and the data points are red if they are less than or equal to 0.5 and blue if the data points are greater than 0.5. The Excel Get Worksheet.vi is responsible for choosing the Sheet number, and the Excel Set Cell Format.vi is responsible for formatting the data accordingly.
There is much information available online regarding custom Excel formatting, for example,this link provides a table of some of these formatting schemes.
Additional Notes
Excel 2007 defaults to 3 Sheets. If you select 3 for the worksheet index, upon creating a new spreadsheet, an error message will occur that says: You specified invalid Word bookmarks or Excel named ranges. It is necessary to insert an Excel Add Worksheet.vi before the Excel Get Worksheet.vi in order to account for a 4th sheet without receiving this error message.
This example requires the Report Generation Toolkit.
This is a screenshot of the Write_to_different_sheet.vi:
This is a screenshot of the Write_to_4th_sheet.vi:
There are no comments on this document