Sets a column of the active sheet to auto-fit its contents. Rows and columns are 1-based. Because a headless engine has no font-metrics renderer, the workbook is written with Excel's best-fit flag and the spreadsheet application computes the exact pixel width when the file is opened. The fluent member form is autoSizeColumn(column) and autoSize() does the same for every column.
spreadsheetAutoSizeColumn(spreadsheetObj, column)
→ returns any
Best-fit column 1 after writing data.
wb = Spreadsheet("xlsx");
spreadsheetSetCellValue(wb, "A long name indeed", 1, 1);
spreadsheetAutoSizeColumn(wb, 1);
wb.write(expandPath("/out.xlsx"), true);
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.