LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read excel file without opening excel

I haven't really found a great answer yet. The closest I got was to find an open source document describing the binary structure of an excel file, but it is a large document and I really haven't taken the time to go through it.

 

Essentially, I'm looking for a simple solution to open an excel file directly for text only content like it is a text file without any external toolkits or applications.

0 Kudos
Message 11 of 16
(1,544 Views)

There is no simple solution. You have the choices you've been given:

  • Use the Report Generation Toolkit, or program it yourself using ActiveX.
  • Use the Database Toolkit, or program it yourself. LabSQL could be used as well in place of the Toolkit. This uses ADO.
  • Use DDE. If you search you will find examples of this.
  • Convert the Excel files to text or CSV.
  • Use the published formats of Excel files and read the file yourself.
Message 12 of 16
(1,537 Views)

from what your saying I would say the best option would be batch convert all the xls files to csv then use read spreadsheet with a ',' as the delimiter. No need for excel and the speed is good

 

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 13 of 16
(1,535 Views)

@PhillipBrooks wrote:

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.

 

 

 



Update to this post made back in  02-14-2012 10:22 AM by PhillipBrooks

 

As we have moved in to .xlsx files these days you should change the "Provider" and "Extended Properties" in the input "connection information".

The string should now say:

 

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%s;Extended Properties='Excel 12.0 Xml;HDR=No';

 

and if you do not have the provider installed, download it here:

 

http://www.microsoft.com/en-us/download/details.aspx?id=23734

 

HDR=No if you want all data and HDR=Yes if you have a Header you don't want to import. 

 

I've attached the my updated version of this very useful file and hope you will not be offended by this Mr. PhillipBrooks. 

 

Thank you!

Message 14 of 16
(1,422 Views)

Hi,

I had the same question, worth than that, I got an error when reusing the VI:

Report Generation Toolkit: Microsoft Word or Excel did not open.

 

My bp resolved with a very simple way, hope it is helpful for you.

Main idea: VI open a first excel file -> Closing it after opening the next.

 

This make the Excel keeping opened but only one file opened at a time.

It works well, no more pb of Microsoft open error, and run speed is good enough.

 

Good luck,

Richun

0 Kudos
Message 15 of 16
(1,082 Views)

@Steve_Block wrote:

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?


If these files are indeed TEXT ONLY then you can just use the Read Delimited Spreadsheet.vi

 

How about posting a sample file?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 16 of 16
(1,063 Views)