views:

53

answers:

2

hi . i have a text and i try to write this text to excel file by c#. this text include not one kind of value. i mean, it can be include "abc" "1.6", "1/6" etc. when i write 1.86 or 1/86 i see "feb.86" in the excel. but i want to see what i write to. what can i do to solve this problem?

A: 

for numbers like 1/86 you can prefix it with '. But then you will get "Number Stored as Text" error in excel (little green triangle in cell). Otherwise you can always put things in double quotes to work:

="1/86"

PS:- procede with "="

TheVillageIdiot
A: 

thanks for answers but when i assign to excel cell to value as 1.86 it is ok but when i assign as a string as you said "1.86" excel converts automatialy. in my program i will use a string to write to excel so my problem is come from here.

what else can i do?

how can set cell format type as a general.

when i write: " excelWs.Columns.NumberFormat = Excel.XlColumnDataType.xlGeneralFormat;" i see another number in the cell such as "2 etc.

i need your help

thanks again