02-14-2012 09:40 AM
I have a bunch of text only excel files that I want to read through to extract data, but the process of opening and closing excel is pretty cumbserome. Does anyone know of any vis that can extract excel spreadsheet data from the raw.xls file as opposed to having to open excel and communicate via the toolkit or activex?
02-14-2012 09:49 AM
Open it with Excel and save as Text file. Open in Labview as a text file. Then you don't need excel.....
02-14-2012 10:06 AM
These are preexisting files so opening and resaving in text format is not a practical option.
02-14-2012 10:07 AM
Is it possible to save the same file as .csv through MS Office? If it is done you can simply use the read from text file VI to read it.
02-14-2012 10:22 AM - last edited on 06-04-2024 07:58 PM by Content Cleaner
If you have the NI Database Connectivity Toolkit, you can use that to open XLS files and read them in as a 2D array of strings.
The trick is the correct connection string. http://support.microsoft.com/kb/257819
See attached LabVIEW 8.6 VI.
02-14-2012 10:50 AM
Hi!
I think using ActiveX you can programmatically open Excel keeping it hidden, so maybe you can reconsider avoiding ActiveX.
As an alternative you can batch-convert all your XLS to CSV.
On the web I've found some hints on how to do this...
Regards,
Marco
02-14-2012 12:03 PM
The issue is execution speed. The toolkit idea might work, but I try to minimize the amount of external toolkits required, because they create a configuration nightmare.
02-22-2012 05:21 PM - last edited on 06-04-2024 07:58 PM by Content Cleaner
Hi Steve,
Good evening. Did the toolkit idea work for you? If not, you might want to look into using TDMS
https://www.ni.com/en/support/documentation/supplemental/06/the-ni-tdms-file-format.html Let me know if this helps or if you need further help.
02-23-2012 06:46 AM
Steve,
Have you tried starting the Excel application, then opening and closing each file? Would eliminate starting and stoping the whole app for each file.
02-23-2012 07:21 AM
the closest i this i have done is use the report generation toolkit to open and read the file, also in this toolkit is a get refnums which can return the excel application refnum which you can use a activex call to hide it. Once your done excel can be closed this way.
hope it helps
TD