1

Is there a way to create a $styleArray automatically from a existing Excel worksheet using PHPExcel?

Something like:

$styleArray = $file->getSheetByName('XY')->getStyles()->
copyAllStylesInRangeAndCreateStyleArray($range);

So I could use this generated style array with

$file->getSheetByName('AB')->getStyle($range)->
applyFromArray($styleArray)`

to copy the style to another sheet (even in another workbook) or save the information in an extra e.g. Config-File.

Or do I have to find a way using duplicateStyle() and go through every cell (compare Styling cells)?

kratsching
  • 75
  • 1
  • 9
  • Maybe it's even better to just use the `addExternalSheet()` functionality? – kratsching Apr 22 '15 at 09:43
  • Afraid not.... I've looked at coding a function to generate a style array from an individual cell styling, but never at building a set of style arrays for a complete worksheet – Mark Baker Apr 22 '15 at 09:49

0 Answers0