This project has moved and is read-only. For the latest updates, please go here.

Error: converting column into integer in excel using EPPlus (

Jun 18, 2012 at 6:03 AM

I am loading data into excel from datatable using LoadFromDataTable method then changed cell format to integer still it is showing error "The number in this cell is formatted as text or preceded by apostrophe".

cell was showing to right side only and number format only on cell property.

still I am not understanding why I am getting this error??.


Dim wsManufacturing As ExcelWorksheet = pck.Workbook.Worksheets.Add("Manufacturing")
wsManufacturing.Cells("A1").LoadFromDataTable(dtManufacturing, True)
 Using col As ExcelRange = wsManufacturing.Cells(2, 2, 2 + dtManufacturing.Rows.Count, 2)
    col.Style.Numberformat.Format = "#,##0"
    col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right
 End Using