AddExternalSheet : Empty cells with incorrect style

Topics: User Forum
Apr 29, 2013 at 11:17 AM
Edited Apr 29, 2013 at 11:53 AM

I am using AddExternalSheet to copy a sheet in a new Excel file.

The original file has a table (with values, and styles/colors).
The new file has correctly the same table (with same values and same styles).

But...columns and/or lines after the table - which are empty and have no style in the original file - have a color/border in the new file.
For example, the table has columns A to G. After G, all cells are empty, and have no style in the original file. In the new file columns from H to IV are empty, but have a style.

Do you have any idea to solve it ? Do you think that the problem comes from the original file ?


EDIT : my current workaround is to make this :
  for($column='A'; $column<'H'; $column++){
    for($ligne=1; $ligne<200; $ligne++){
      $xfType = $objClonedWorksheet->getStyle($column.$ligne)->getFill()->getFillType();
      if ($xfType == none) { $objPHPExcel->getActiveSheet()->getStyle($column.$ligne)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_NONE);}