tags:

views:

15

answers:

1

Hello All,

I am reading excel file using Microsoft.Office.Interop.Excel. It works fine in all the case but in some case like superscript or subscript, its not working!

CM2 - Here 2 is superscript, but i am getting CM2 not cm2 [cm-square]

Any help in that direction will be appreciated.

Imran

A: 

Not sure how helpful this is but, look at the Font property of the cell:

Excel.Range someRange = (Excel.Range)ws.Cells[1, 1];
Excel.Font aFont = someRange.Font;
if (aFont.Superscript == DBNull.value) System.Console.WriteLine("mixed superscript and regular");
else if ((bool) aFont.Superscript == false) System.Console.WriteLine("no superscript");
else if ((bool) aFont.Superscript == true) System.Console.WriteLine("all superscript");
Mark
Well, thanks for your response, I am interested into value not the existence of superscript of subscript, my generic program reading all values from excel, it fails in this case. It returns simple text but I need formatted text.
IBhadelia