Hello! I am trying to set column width but it doesn’t work. Any comment will be helpfulimage.png (20.5 KB)
It might be an issue with the API you are using. We suggest you to try Aspose.Cells APIs (you may choose your desired API for your environment/platform) instead. See the following sample code using Aspose.Cells for Java API to perform your exact task, it works fine and as expected with it:
e.g.
Sample code:
Workbook workBook = new Workbook("f:\\files\\Book1.xlsx");
//Get the first worksheet
Worksheet worksheet = workBook.getWorksheets().get(0);
//Get the column width of the first (A) column
System.out.println(worksheet.getCells().getColumnWidth(0));
//Set column width
worksheet.getCells().setColumnWidth(0, 150);
//Get the updated column width of the first (A) column
System.out.println(worksheet.getCells().getColumnWidth(0));
Hope, this helps a bit.