C# Excel Date value is coming as numeric value
<p>An excel file is generated by a third party app. I am writing a utility to further process that Excel file. When I read a column containing date value, I am getting a numeric string like 05/02/2016 (dd/MM/yyyy) is coming as 42405.</p>

<p>I have tried using .Text, .Formula, .Value, .Value2 - all the approaches are returning the numeric value.</p>

<p>I know about FromOADateTime, but my requirement is to read the date value as a string, exactly the way it is displayed on the screen.</p>

<p>Thanks.</p>

<p>EDIT 1:
When I convert the column to Text in Excel, by using Format Cells and selecting Text, all the date values convert to numeric values even in Excel! Does that give any clue? Probably the third party app stores the data as numeric value, but Excel displays it as a date string on screen. I want to read the value displayed on screen.</p>

<p>EDIT 2:</p>

<p>This problem does not come with all the date values in that column. My first impression is that the third party app is not consistent while writing date values to Excel. But I have no control over it. </p>

<p>EDIT 3:
Here is the link to download file: <a href="http://wikisend.com/download/316956/Prob.xls" rel="nofollow noreferrer">http://wikisend.com/download/316956/Prob.xls</a> . In this file, I need to read all date values in Column B as text starting from Row 13</p>

<p>And here is the link to the screenshot of how it looks in my machine: <a href="http://wikisend.com/download/443994/Screenshot1.jpg" rel="nofollow noreferrer">http://wikisend.com/download/443994/Screenshot1.jpg</a></p>

<p>EDIT 4:
Found the culprit in my code with the help of NineBerry's answer: a few lines before reading the Text property, I was calling ws.Columns.ClearFormats() and ws.Rows.ClearFormats();</p>

<p>I needed to do this as per this: <a href="https://stackoverflow.com/questions/1284388/">How to get the range of occupied cells in excel sheet</a>…, in order to correctly get the used range in the sheet!</p>

<p>The original problem is solved. Now the problem is how to use ws.UsedRange without calling ClearFormats() to correctly get the range of used cells.</p>

<p>My specific requirement is to get the range of used ROWS having data in any cells up to Col H. I Dont need the entire UsedRange in Excel, UsedRange within Col H is good enough for me. </p>

<p>Any solutions to this? Or should I post a new thread?</p>