Example Code

Inserting a Hyperlink Into Excel Using the LabVIEW Report Generation Toolkit

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 Report Generation Toolkit
  • LabVIEW

Code and Documents

Attachment

Overview
This VI displays the functionality of a state machine by controlling the execution of a code.


Description
Inserting a hyperlink into an Excel worksheet is not a feature available in the Report Generation Toolkit.  This example is one way to insert a hyperlink into a worksheet.  The example uses an Excel macro (saved as a .bas file) to add the hyperlink to the worksheet.  The VI Opens an Excel Workbook (.xls) and load the AddHyperlink macro.  The example then runs the macro, removes the macro from the workbook, and saves the document.


Requirements

  • LabVIEW Base Development System 2012 (or compatible)
  • Report Generation Toolkit


Steps to Implement or Execute Code

  1. Download the zip file "Add Hyperlink to Excel 2012 NIverified.zip"
  2. Open the VI "Add Hyperlink to Excel 2012 NIverified.vi"
  3. Select an Excel file to modify
  4. Choose a Cell to modify, URL to paste, and Link text
  5. Run the VI

 

Additional Information or References

VI Block Diagram

block.png

 

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

Regards,

Mike Altmann
Product R&D
NI

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