cheenu_2002 Posted September 13, 2004 Report Share Posted September 13, 2004 I want to read from a excel file which contains both strings and numbers. I tried using read characters from file.vi and read from spreadsheet file.vi but it doesn't work .Can anyone help me with an example on how to read from an excel file. Thanx in advance. Quote Link to comment
didierj Posted September 13, 2004 Report Share Posted September 13, 2004 You can't read excel files, because they are not plain text. LV either reads just plain text (tab separated text-file) or binary. Reading binary also reads all the formatting in the .xls file, thus you won't have usable data in LV. To read .xls files you'll have to use active-X. This means, control Excel from your app, let excel read the file and then read the cell data from excel (so do other applications that read excel files, like word with embedded excel sheet in your document). For first help see the examples of LV (Menu: help>>find examples...): Write Table to XL.vi or from the knowledge base of NI (www.ni.com, "NI Developer Zone"). It's not the easiest job, since the object model of Microsoft is quite deep in hierarchy and depend on your office version. If possible, you should consider to save your excel sheet as .csv file (which is a comma-separated text file, easy readable from LV) in excel. A good help is also the report generation toolkit from LabVIEW, but it's not free of charge. Didier Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.