How to get individual xls cell value

7 views
Skip to first unread message

Peter

unread,
Feb 25, 2008, 1:03:59 AM2/25/08
to CSVChat
Hello Bruce,

I have an xls spreadsheet which is really messy with fields and there
are no real columns.
How do I use datastreams.xls to get the value of individual cells.
I am pretty confident I can run loops using x, y positions to get the
data I need, but I cannot figure how to get individual cell values.

Thanks
Peter

shriop

unread,
Feb 25, 2008, 1:12:46 AM2/25/08
to CSVChat
XlsReader has a method to get the value using an x,y coordinate,
http://www.csvreader.com/csv/docs/DataStreams.Common.SpreadsheetReader.Item2.html
. Using C#, it's reader[x, y], and using VB.Net, it's reader.Item(x,
y). It's inherited from the base SpreadsheetReader class. There's also
a RecordCount property, http://www.csvreader.com/csv/docs/DataStreams.Common.SpreadsheetReader.RecordCount.html
, so you know how many records are in the sheet. There should probably
have been a way of finding the number of columns in the sheet without
looping over each record but there currently is not. Hopefully you
have logic to determine how many columns there are.

Bruce Dunwiddie

Peter

unread,
Feb 26, 2008, 3:50:54 AM2/26/08
to CSVChat
Thanks Bruce.

On Feb 25, 5:12 pm, shriop <shr...@hotmail.com> wrote:
> XlsReader has a method to get the value using an x,y coordinate,http://www.csvreader.com/csv/docs/DataStreams.Common.SpreadsheetReade...
> . Using C#, it's reader[x, y], and using VB.Net, it's reader.Item(x,
> y). It's inherited from the base SpreadsheetReader class. There's also
> a RecordCount property,http://www.csvreader.com/csv/docs/DataStreams.Common.SpreadsheetReade...
> , so you know how many records are in the sheet. There should probably
> have been a way of finding the number of columns in the sheet without
> looping over each record but there currently is not. Hopefully you
> have logic to determine how many columns there are.
>
> Bruce Dunwiddie
>
> On Feb 25, 12:03 am, Peter <dotnetconn...@gmail.com> wrote:
>
>
>
> > Hello Bruce,
>
> > I have an xls spreadsheet which is really messy with fields and there
> > are no real columns.
> > How do I use datastreams.xls to get the value of individual cells.
> > I am pretty confident I can run loops using x, y positions to get the
> > data I need, but I cannot figure how to get individual cell values.
>
> > Thanks
> > Peter- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages