Format date cells in excel2/21/2023 If I remove the row: cell3.StyleIndex = 1 Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.” However when I try to open the document, I receive this message: “Excel found unreadable content in 'test.xlsx'. The code executed creates the Excel document. Var fileVersion = new FileVersion Ĭell2.CellValue = new CellValue((50.5).ToString()) Ĭell3.CellValue = new CellValue(().ToString()) Ĭell3.StyleIndex = 1 // <= here I try to apply the style. String relId = workbookPart.GetIdOfPart(worksheetPart) Var worksheetPart = workbookPart.AddNewPart() WorkbookPart workbookPart = myWorkbook.AddWorkbookPart() Static void Main(string static void BuildExel(string fileName) I don’t have any problem to fill the values in the sheets however I am struggling to set the classic Date format in a cell.īelow a quick test using DocumentFormat.OpenXml and WindowsBase references. I am trying to create an Excel file in xlsx format using OpenXML because I need to use that on a web server.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |