The problem is that OwnerDrawCell is only fired for visible cells on the form. If you were using SetCellStyle in OwnerDrawcell, then that method is never called for cells that are never made visible on the form, so off-screen cells are never assigned a style. Using "None" and "AsDisplayed" for the FileFlag in SaveExcel() should carry over styles for all cells assigned a style.
So a workaround is to manually set the styles yourself before calling SaveExcel. If using SetCellStyle, you can reproduce the same behavior of OwnerDrawnCell outside that event and force it on all cells by just cycling through every cells checking and applying the style(s). Or you can just call the OwnerDrawCell event manually for each cell prior to saving to Excel:
Dim g As Graphics = C1FlexGrid1.CreateGraphics
For r As Integer = 1 To C1FlexGrid1.Rows.Count - 1
For c As Integer = 0 To C1FlexGrid1.Cols.Count - 1
C1FlexGrid1_OwnerDrawCell(C1FlexGrid1, New C1.Win.C1FlexGrid.OwnerDrawCellEventArgs(C1FlexGrid1, g, r, c, C1FlexGrid1.GetCellStyle(r, c), C1FlexGrid1.GetCellRect(r, c, False), C1FlexGrid1.Item(r, c), C1FlexGrid1.GetCellImage(r, c)))
Next
Next
C1FlexGrid1.SaveExcel("C:\flexformat.xls", "Sheet1", FileFlags.None)
Hope that helps,
- Greg L