To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates how to search in Excel through LabVIEW using ActiveX.
Description
Many applications in the Windows environment give access to some of their most basic functions to a centralized framework called ActiveX. This allows for cross program interaction in a simple fashion. Available functions include "Start" and "Stop" in such programs as Windows Media Player and document formatting in Microsoft Word and Excel. This example allows you to search a Microsoft Excel spreadsheet for a specified string from within LabVIEW. LabVIEW opens Excel and uses the Find function within Excel and then retrieves the results.
Requirements
LabVIEW 2012 (or compatible)
Windows Excel
Steps to Implement or Execute Code
1. Downlaod the zipped folder "Search in Excel_LV2012_NI Verified"
2. Open the project and launch the VI "Search Excel_LV2012_NI Verified"
3. Choose the path of the Excel file
4. Enter the Sheet you want to search within
5. Enter the String to Find
6. Run the VI
Additional Information or References
Front Panel
Block Diagram
Notes
Please note the ActiveX interface is specific to Microsoft Excel, as a result there is limited documentation on using the interface. All the documentation can be found from Microsoft on the MSDN.
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Very nicely done example.
The Excel file must be closed or else an "unknown" error is returned.
Hi,
Can you help me? I have more than one result string and I want to find all address of cells where "String To Find" exist (like a button "Find All" in Excel)
Thanks
Searching and finding all position of a given string in an excel sheet. developed using labview 2012
Hello! anybody have the vi to find all position? can attach? i can't find how to add the invoke node for range.
Hi,
Very nicely done.
I need to search only in row A how can i do this ?