How to change column width and row height (xlsx)?

Jul 16, 2009 at 2:26 PM
Edited Jul 16, 2009 at 6:22 PM

Hi James,

 How to change column width and column color  in code?

Thanks

Jul 17, 2009 at 5:52 AM
Edited Jul 17, 2009 at 5:57 AM

Column width:

 

Columns cols = new Columns( new Column() { Min = 7, Max = 7, CustomWidth = true, Width = 20} );

worksheetPart.Worksheet.InsertBefore<Columns>(cols, worksheetPart.Worksheet.GetFirstChild<SheetData>());

 

"Min = 7 and Max = 7" is the columns number