[php] Setting width of spreadsheet cell using PHPExcel

I'm trying to set the width of a cell in an Excel document generated with PHPExcel with:


but that does not works.

What is the method that I need to call here?

This question is related to php phpexcel phpspreadsheet

The answer is

It's a subtle difference, but this works fine for me:


Notice, the difference between getColumnDimensionByColumn and getColumnDimension

Also, I'm not even setting AutoSize and it works fine.

Similar questions with php tag:

Similar questions with phpexcel tag:

Similar questions with phpspreadsheet tag: