phpspreadsheet
Merge Cell values with PHPExcel – PHP
There is a specific method to do this: $objPHPExcel->getActiveSheet()->mergeCells(‘A1:C1’); You can also use: $objPHPExcel->setActiveSheetIndex(0)->mergeCells(‘A1:C1’); That should do the trick.
Setting width of spreadsheet cell using PHPExcel
It’s a subtle difference, but this works fine for me: $objPHPExcel->getActiveSheet()->getColumnDimension(‘A’)->setWidth(10); Notice, the difference between getColumnDimensionByColumn and getColumnDimension Also, I’m not even setting AutoSize and it works fine.