Page 1 of 1
Read an xls file

Posted:
April 12th, 2006, 7:52 am
by kotsaris
Hi i am new in delphi programming and i have a problem
i want to open a xls file which contain single numbers like
that
0,1__0,3__0,002
0___0,2__ 0
0___0,4__ 0
and put them into an array of array of single
has anyone any idea?

Posted:
April 12th, 2006, 8:37 am
by Kambiz
The easiest way is to use IXMLDocument interface.

Posted:
April 12th, 2006, 10:39 am
by kokkoras
How about an Excel OLE object (from the Servers pallete)?

Posted:
May 22nd, 2006, 9:21 pm
by werdnareid
you can use a combination of ADODB connection and a ADODB dataset to access the xls file.
your connection string shoule look like this
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=myfile.xls;Extended Properties=excel 8.0;Persist Security Info=False
where myfile.xls is the file to open.
your dataset will have the connection property set to your ADODB connection object
then your dataset will look like this
select Code, Description from [uncpccode$]
uncpccode$ is the name of the page in my workbook where the data is located
you can attach the data set to a grid is you like