c# - Font error in formula box in Excel? -


i have excel file (.xls), has 1400 rows, there rows displayed in correct font (both in sheet cells , in formula box docked @ top). there rows displayed right font in sheet cells if select , @ formula box, displays text of selected row in wrong font (some kind of error or unsupported font).

my excel file's content contains unicode text, laptop installed common unicode fonts (simply language need unicode display , have many unicode fonts installed). i'm using excel 2013, don't think problem related missing font... maybe formula box , sheet cell use different fonts. noticeable point cells have contents displayed wrong font in formula box (i call these cells group b cells) formatted different font other cells (i call these group cells). i've tried changing font of group b cells font of group cells contents displayed wrong font (both in cells , in formula box) then.

if every work handles excel file only, there not big problem, have project has import excel file database. i've tried demo , loads excel file lots of font errors. these errors exact displayed in formula box see in excel window. don't know how fix this. problem customer supposes excel file ok, , looks (because cells' contents displayed ok in cells, errors in formula box). don't have reason require customer excel file.

i'm using npoi read excel file, think reads cell's content in same way formula box reads, i've tried applying correct font every row before reading string doesn't seem work. have idea on this, need suggestion , don't hope complete or perfect solution (i know not easy)? first ideas trying make cells' contents displayed right/correct font in formula box in excel window first , trying using code npoi (or lib), import excel file normally, hope there simpler solution extracts content (with correct font) right when reading cells.

your suggestions me in solving problem. thanks!

===========================================================

update sample xls file xls file

i using excel 2010 on win 7 64b.

i not have .vntime font installed screenshots see seeing , there appears disconnect between cell displays (font-formatted text) , formula bar displays. somehow, impacts way application reading cell values.

in cases safe read cell range object.

three alternatives may try change code read the:

  • cell.formula, or
  • cell.text, or
  • cell.value

one potential problem formatting may unique excel, , if underlying character set not supported application, database, or client's systems/computers, sort of mismatch error may persists.

there may additional information (although pertains number & date formatting) here:

http://blogs.office.com/b/microsoft-excel/archive/2007/11/12/manipulating-and-massaging-data-in-excel.aspx


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -