Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am using the .Net 4.0 and excel 2003

How can i use an oledb connection to retrieve the cell format of an excel spreadsheet... I specifically want to find out if a cell column (or cell itself) is in a numeric percentage format.

I cannot seem to find this information in the GetOleDbSchemaTable method.

EX: My web app reads numbers from an excel spreadsheet. This works fine; However, if the numbers are in a percentage format, excel displays it as (fraction*100) but the actual value is a fractional decimal (1/3 = .3333..) - Excel displays as 33.33% - (Notice the decimal point).

Therefore, i need a way of distinguishing between what is a percentage & what is not to allow my webapp to work properly...

Any ideas?
Thanks in advance.....
Posted
Updated 22-Jun-10 3:27am
v3

1 solution

There are more than just percentage formats that can cause issues when trying to read Excel cell values. Take a look at this MSDN article [^]on retrieving cell values; it has a lot of useful code snippets.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900