المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : not able to read data from excel sheet using Microsoft.Office.Interop.Excel



C# Programming
10-03-2009, 04:50 AM
I do have code which is reading the data from an excel sheet properly. but have a weird issue.

If the excel sheet has a column containing long numbers data eg. 89.00000001 and if that column is not resized to its max, that cell is displaying "#####" if you open the excel sheet. So my application code is also reading it as "#####" instead of the correct data. If i resize that column to display the data properly and save, then my application code is reading the data correctly.

I can have my users to have the input excel sheet have all the columns maximized, but was wondering if there any way to have it done programmatically.

Do let me know.

My code snippet is :
// get data in cell
for (int i = 2; i