I am using PHPExcel library for reading Excel file. I want to get each column width.
I am trying the following code.
$objWorksheet->getColumnDimension('A')->getWidth();
$objWorksheet->getColumnDimension('B')->getWidth();
It always returns -1 not exact width of Column.. If I use following codes before.
$objWorksheet->getColumnDimension('A')->setAutoSize(true);
$objWorksheet->calculateColumnWidths();
It returns auto size width not exact width from Excel file.
Can anyone help me? Here is screenshot of my excel file.