Read an xls file

Please discuss general Delphi programming topics here.

Read an xls file

Postby kotsaris » April 12th, 2006, 7:52 am

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?
kotsaris
Member
Member
 
Posts: 1
Joined: April 12th, 2006, 7:44 am
Location: GR

Postby Kambiz » April 12th, 2006, 8:37 am

The easiest way is to use IXMLDocument interface.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » April 12th, 2006, 10:39 am

How about an Excel OLE object (from the Servers pallete)?
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby werdnareid » May 22nd, 2006, 9:21 pm

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
werdnareid
Active Member
Active Member
 
Posts: 22
Joined: August 6th, 2003, 5:35 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron