How to find out how many rows and columns to read from an Excel file with PHPExcel?

$objPHPExcel->setActiveSheetIndex(0)->getHighestColumn(); and $objPHPExcel->setActiveSheetIndex(0)->getHighestRow(); or $objPHPExcel->setActiveSheetIndex(0)->calculateWorksheetDimension(); which returns a range as a string like A1:AC2048 although trailing blank rows and columns are included in these. EDIT or you can use the iterators to loop through the existing rows and columns to get each cell within the worksheets used range. See /Tests/28iterator.php in the production distribution for … Read more

failed to delete buffer. No buffer to delete

That error is just telling you that there was no buffer to delete. To avoid it just use: if (ob_get_contents()) ob_end_clean(); (check if there’s an active output buffer) or: if (ob_get_length()) ob_end_clean(); (checks if there’s a non empty string in the buffer) as suggested by @Venu. also you are calling ob_end_clean(); two times there. And … Read more

PHPExcel very slow – ways to improve?

Is it populating the worksheet? or saving? that you find too slow? How are you populating the spreadsheet with the data? Using the fromArray() method is more efficient than populating each individual cell, especially if you use the Advanced Value Binder to set cell datatypes automatically. If you’re setting values for every individual cell in … Read more

phpexcel freeze row and columns

I assume you’re trying to Freeze columns and rows both. freezePane will obviously overwrite any previous parameters you might have given to it. As per your current scenario, I see that you’re trying to freeze the top row and the left-most 3 columns Try this: $objPHPExcel->getActiveSheet()->freezePane(‘D2’); This will freeze Row 1 and Columns A,B & … Read more

Set Font Color, Font Face and Font Size in PHPExcel

I recommend you start reading the documentation (4.6.18. Formatting cells). When applying a lot of formatting it’s better to use applyFromArray() According to the documentation this method is also suppose to be faster when you’re setting many style properties. There’s an annex where you can find all the possible keys for this function. This will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)