-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Iamtheoneurwarnedabout
Message 4 in Discussion
Hi Mrinal, Yes, one way to read the Excel file, is using OleDB. But Iam using COM
interop object(Excel 9.0 object). I wanted to do using the above said object. Iam
able to read the file, but iam failing to get the row count in anExcel sheet. Let say
I ahve excel sheet"Sheet1", in that I have 6 cells with 10 rows of data. Here Iam not
able to get the rox count (10 here in this case) So Iam just hardcoding increment
value in for loop to read all the 10 rows in the excel sheet. When I tried to do
like this : Excel.WorkSheet WrkSht; int iCnt = WrkSht.rows.Count; for(int i = 0;
i<iCnt;i++) {
Excel.Range range = worksheet.get_Range("B"+i.ToString(), "D" + i.ToString());
System.Array myvalues = (System.Array)range.Cells.Value;
string[] strArray = ConvertToStringArray(myvalues);
lstViewXL.Items.Add(new ListViewItem(strArray)); } ConvertToStringArray is an
function. Iam getting row count as 65535 (means it is returning entire row count of
an Excel sheet). Is there any way to come out of this ???? Made an comparision
between oledb and Excel Object, which one is good..??? Regards, Arshad
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]