Hi Christian,
The possible cause may be because the EntireColumn or Row set to some Cell style. Setting some style properties causes creation of each cell and setting its style. MS Excel in such case sets default column style thats why file size change using MS Excel. In XlsIO setting styles using the following code
sheet.Range["A1:A3"].EntireColumn is equal to sheet.Range["A1:A65536"] and
sheet.Range["A1:A65536"].CellStyle.Font.FontName="Arial"; is equal to
for( int i = 1; i <= 65536; i++ )
{
sheet.Range[ i, 1 ].CellStyle.Font.FontName = "Arial";
}
If your requirement is to set styles that apply to a whole column then please use the alternative approach
//Custom Styles
IStyle threeColumnsStyle = workbook.Styles.Add("ThreeColumnStyle");
threeColumnsStyle.FillBackgroundRGB = Color.Red;
for(int i=1;i<=3;i++)
{
//Set Styles
sheet.SetDefaultColumnStyle(i,threeColumnsStyle);
}
Here is a sample for your reference,
Sample:
http://websamples.syncfusion.com/samples/XlsIO.Windows/F66593/main.htmkindly take a look and let me know if you have any other questions.
Regards,
Ajish.