LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read excel file without opening excel

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?

0 Kudos
Message 1 of 16
(6,149 Views)

Open it with Excel and save as Text file. Open in Labview as a text file. Then you don't need excel.....

0 Kudos
Message 2 of 16
(6,142 Views)

These are preexisting files so opening and resaving in text format is not a practical option.

0 Kudos
Message 3 of 16
(6,133 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 16
(6,132 Views)

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.

 

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 5 of 16
(6,127 Views)

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

0 Kudos
Message 6 of 16
(6,116 Views)

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.

0 Kudos
Message 7 of 16
(6,104 Views)

Hi Steve,

 

Good evening. Did the toolkit idea work for you? If not, you might want to look into using TDMS

 

http://zone.ni.com/devzone/cda/tut/p/id/3727. Let me know if this helps or if you need further help.

 

 

 

 

 

 

Sunaina K.
Product Marketing Manager for CompactRIO & TSN

Making the intangible, tangible
0 Kudos
Message 8 of 16
(6,065 Views)

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.

0 Kudos
Message 9 of 16
(6,050 Views)

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 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 10 of 16
(6,043 Views)