Board index » cppbuilder » Read cells from Excel

Read cells from Excel


2005-02-19 09:33:52 PM
cppbuilder53
Hi there. Can you explain how to use the excel component to retrieve
some data from an excel file's cells? I tryed to find in some news but
nothing..
I use CBuilder 6.
tnx in advance, Giovanni
 
 

Re:Read cells from Excel

I never worked with Office components, and I see that
many complains about lack of documentation for it.
You can use some other concept that BCB6 has. That's
ADO which you can use to retreive data like with any 'real'
database:
Use connection string /for example/:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\Test.xls;Extended
properties=Excel 8.0
Query can be:
From sheet:
select * from [Sheet1$]
Sometimes the $ should be placed before ($Sheet1)
From named diapason:
select * from [DiapasonName]
From range:
select * from [Sheet1$B5:C10]
For additional questions (if you wat to use ADO) consider
the 'ado' group.
--
Best regards,
Vladimir Stefanovic
"Giovanni" < XXXX@XXXXX.COM >wrote in message
Quote
Hi there. Can you explain how to use the excel component to retrieve some
data from an excel file's cells? I tryed to find in some news but
nothing..
I use CBuilder 6.
tnx in advance, Giovanni