07-09-2019 07:53 PM
Hi everyone,
I am quite new to labview. I was wondering if there is any way to search a specific value in an excel file using labview. For instance,
name age
x 10
if I have a file containing the above information, I want to search for x and get 10 in return.
I would upload a picture or the code, but I am still in the designing my code phase so I dont have either. I was thinking about the potential possible ways to do this without using activeX.
Thanks for the help,
Kaawn
07-10-2019 09:39 AM
Two suggestions:
07-10-2019 09:46 AM
There are several Third-Party-Toolkits available on the Toolsnetwork, that can read or write excel files (xlsx and partially xls) without relying on the ActiveX methods provided by a installed Excel program.
Regards, Jens
07-10-2019 10:26 AM
Hi Aputman,
There is no specific reason behind not using activeX. I am just trying to figure out if there is any other way around it. Also does activeX work with all the versions of labview. I am using labview 8.0. I am quite new to labview, so if labview 8.0 does support activex, would you guide me on how to make that work for my problem?
Thanks,
Kaawn
07-10-2019 10:27 AM
Hi Jens,
Is there any specific one that you could recommend?
Thanks,
Kaawn
07-10-2019 11:03 AM - edited 07-10-2019 11:07 AM
Frankly I have had several issues over the years using ActiveX. There is no way to be certain any one PC will have all the ActiveX components (for lack of a better word) and that they will be compatible with your code.
I have had several ActiveX automated Excel methods fail on target machines (INCLUDING NI's own examples) and worked with NI on the issue. In the end NI basically threw up their hands and said some ActiveX thing or another was incompatible.
So I avoid using ActiveX in general
07-10-2019 11:08 AM
Hi RTSLVU,
I was looking for something that would not cost money. Yeah it is probably faster and easier, but I was wondering if I could use anything from what labview already has like the read from a spreadsheet or something like that to read a specific value from an excel file.
Thanks,
Kaawn
07-10-2019 11:13 AM - edited 07-10-2019 11:14 AM
Well if you save your Excel file as a .CSV you can use the "Read Delimited Spreadsheet" vi to read it.
Actual Excel (.XLSX) files are a compressed XML format that can't be directly read.
07-10-2019 11:16 AM
Hi RTSLVU,
Yeah, that is what I am trying to do but I cannot get any specific value out of it. I can either get the entire data or the first column, but how do I search for a specific value in a given row and column?
Thanks,
Kaawn
07-10-2019 11:20 AM
@kaawn wrote:
Hi RTSLVU,
Yeah, that is what I am trying to do but I cannot get any specific value out of it. I can either get the entire data or the first column, but how do I search for a specific value in a given row and column?
Thanks,
Kaawn
As I said in my post above, import the CSV into an array and you can search values there.