Write string 001 into a cell

I try to write the string 001 into a cell. 


First I format the cell as text, then I use the SetCellFromString procedure on the workbook. Here flexcel calls the ConvertString method on the TXlsFile class. Flexcel convert there the value to a number. How can I avoid that? 

thanks.

Hi, 

SetCellFromString is expected to do exactly that, convert a string like '001' into a number 1. For this reason you shouldn't use it too much, because it has to guess what data type it is.

If you want to enter the string '001', just use the code:

xls.SetCellValue('001' );

SetCellValue will enter the datatype you pass to it, and it is the preferred way to enter cell values.
xls.SetCellValue('1') will enter the string '1'
xls.SetCellValue(1) will enter the number 1