Hi everyone.
I'd like to ask a question about cell styles in 8.4.0.10.
i generated attached document using following code:
Dim x As New ExcelEngine
Dim app As IApplication = x.Excel
Dim wb As IWorkbook = app.Workbooks.Create(1)
wb.Version = ExcelVersion.Excel97to2003
Dim sheet As IWorksheet = wb.Worksheets(0)
Dim xlst As IStyle
xlst = wb.Styles.Add("TestStyle")
xlst.WrapText = True
xlst.Color = Color.AntiqueWhite
xlst.HorizontalAlignment = ExcelHAlign.HAlignCenter
xlst.VerticalAlignment = ExcelVAlign.VAlignCenter
xlst.Borders.LineStyle = ExcelLineStyle.Thin
xlst.Borders(ExcelBordersIndex.DiagonalDown).ShowDiagonalLine = False
xlst.Borders(ExcelBordersIndex.DiagonalUp).ShowDiagonalLine = False
xlst.Font.FontName = "Tahoma"
xlst.NumberFormat = "dd.MM.yy hh:mm"
sheet.Range(1, 1).CellStyle = xlst
sheet.Range(1, 1).Value = DateTime.Now
sheet.Range(1, 1).AutofitColumns()
wb.SaveAs("d:\SyncTest.xlsx")
wb.Close()
The problem is that now cell A1 cannot be formated by user when file is opened in Excel (tried opening attached file in 2010 and 2003, failing both times).
On the other hand, if i create Excel2010 file, cells with style applied can be formatted by user.
Any ideas what am i doing wrong?
SyncTest_fbe5991.zip