Example Code

Delete Columns in Excel Spreadsheet Using LabVIEW and Excel ActiveX Server

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

This example prompts for a file and for the letter of the column to delete.


Description
Using the Excel ActiveX Server, you can open a reference to an Excel spreadsheet and delete a given column. It saves the file to the same location/filename with " - modifed" added to the file name using regular expressions.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  • Run the program
  • Select the excel file to revise.

 

Additional Information or References
VI Snippet

3-367.png

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

Eric B.
National Instruments

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

Comments
SeanJ
Active Participant
Active Participant
on

I'm just wondering, how does one create an application refnum.  In this case it is Excel.Application, where did it come from?

SeanJ
Active Participant
Active Participant
on

Ok, sorry it's simple.  Insert an automation control on the front panel or auomation refnum on the block diagram.  Right click and select activex class.

windows
Member
Member
on

Hello!

i have few doubts,

1. i am not able to find excel.application:

i right clicked on input of automation block and click on browse. I am not sure how to select excel.application.

2. with the example you provided, i am not able to select properties for property node. Here are the images i came accross.1.png2.pngUntitled.png

Srikanth Chilivery,
soupy
Member
Member
on

I had the  same issue where Excel.Application was not showing up in the type library even though Excel came pre-installed on my laptop. I resolved it by going to my Office365 page and selecting the "Install Office" link. I'm not sure if it made a difference, but I also chose to install office with the same bitness (32 vs. 64) to match my LabVIEW install.