2016-10-04 6 views
3

Ich verstehe, dass die Frage dumm und von FAQ, aber ich kann nicht in Excel-Spalt Auto Breite eingestellt (mit ClosedXML.Excel Bibliothek)Autofit Spalte in ClosedXML.Excel

mein Code:

var wb = new XLWorkbook(); 
var wsDep = wb.Worksheets.Add("MyWorksheet"); 
wsDep.Columns("A").AdjustToContents(); 
wsDep.Columns("B1").AdjustToContents(); 
wsDep.Columns().AdjustToContents(); 

aber Nichts verändert sich. Wie kann ich automatische Breite Spalten mit ClosedXML.Excel Bibliothek ??

+0

@FrancoisBotha - vielleicht eine Antwort, könnte es akzeptiert werden. –

+0

@krabcore Ist meine Antwort ausreichend? –

Antwort

6

Ihre Zellen haben keinen Inhalt. Daher wird AdjustToContents() keine Wirkung haben.

Verwandte Themen