• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

C# Question about how to retrive formatted data from EXCEL

I have a C# windows application that imports data from EXCEL files.  Right now it just reads in the unformatted data meaning this is the data without any EXCEL masking or special or custom formatting.    For example;

Stock Number Cell

The cell above shows value 4.50 when opened in EXCEL but the real value is 04.5099383.  I want to know if it is possible to read in the formatted value which in this case would be 4.50 instead of the unformatted value.  How can I do this in c#?  I am using Visual Studio 2010.
1 Solution
Alexandre SimõesManager / Technology SpecialistCommented:
What are you using to read the excel file?

Cells store the value, formatting is applied on top, so the solution is to get both value and format mask from the cell.

If you use OpenXML SDK for instance, you can get the format applied to the cell and use it in C# to format the value.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now