ConsoleApplication5.zip
hi https://www.nullskull.com/forumtree.aspx?userID=f2b3bdab-56ba-4ad0-9612-58e4a49f1417
you need to set format to the specified cell what you want, Acey.ExcelX provides interface name: ICellFormat,
this interface can set format for a single cell, a range, entire row and column, you can see CellFormat property in
ICell interface. you write and test it, it works fine.
the following code:
//Creates a Workbook object.
IWorkbook workbook = ExcelxApplication.CreateWorkbook();
//Gets a worksheet object by zero-based index in workbook.
IWorksheet worksheet = workbook.Worksheets[0];
//Gets a cell by zero-based row and column index.
ICell cell = worksheet.Cells[0, 0];
//Sets value to the Cell object.
cell.Value = 12;
//Sets the number format
cell.CellFormat.NumberFormat = "0.00%";
//Saves as the sepcified excel file format.
workbook.SaveAs(@"d:\book1.xls", FileFormat.Excel97To2003);
you can download the attached file.
regards