{"action":"opened","issue":{"url":"https://api.github.com/repos/PHPOffice/PHPExcel/issues/886","repository_url":"https://api.github.com/repos/PHPOffice/PHPExcel","labels_url":"https://api.github.com/repos/PHPOffice/PHPExcel/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/PHPOffice/PHPExcel/issues/886/comments","events_url":"https://api.github.com/repos/PHPOffice/PHPExcel/issues/886/events","html_url":"https://github.com/PHPOffice/PHPExcel/issues/886","id":149828003,"number":886,"title":"Clone method changes background color in Excel2007; works fine with Excel5","user":{"login":"DaveBowman","id":6858156,"avatar_url":"https://avatars.githubusercontent.com/u/6858156?v=3","gravatar_id":"","url":"https://api.github.com/users/DaveBowman","html_url":"https://github.com/DaveBowman","followers_url":"https://api.github.com/users/DaveBowman/followers","following_url":"https://api.github.com/users/DaveBowman/following{/other_user}","gists_url":"https://api.github.com/users/DaveBowman/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveBowman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveBowman/subscriptions","organizations_url":"https://api.github.com/users/DaveBowman/orgs","repos_url":"https://api.github.com/users/DaveBowman/repos","events_url":"https://api.github.com/users/DaveBowman/events{/privacy}","received_events_url":"https://api.github.com/users/DaveBowman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-20T17:00:32Z","updated_at":"2016-04-20T17:00:32Z","closed_at":null,"body":"I have an Excel XLSX file with some data and formatting that I want to use as a template, then clone the sheet using PHPExcel. When I clone the sheet using the Excel2007 reader, my background fill colors are set to black (or maybe are 'undefined'...?) - meaning: if I click in one of the fields and try to type in it, the background fill is set to . If I change to use the Excel5 reader (and save my template as an XLS file), it works fine.\r\n\r\nThis is what happens when I try to type in a cell:\r\n![image](https://cloud.githubusercontent.com/assets/6858156/14683152/38d44efa-06f7-11e6-9598-e1cc1fdb6076.png)\r\n\r\nIf I look at the format cells options (Right-click > Format Cells > Fill tab), the \"Pattern Color\" field should be on automatic (as it is in my template file), but it appears to either be unset or on black:\r\n![image](https://cloud.githubusercontent.com/assets/6858156/14683185/674f9ef6-06f7-11e6-94d2-ec588075d210.png)\r\n\r\n\r\n```\r\n    // This code does not work as intended; see screenshot link in text above.\r\n    $excelObjSource = PHPExcel_IOFactory::createReader('Excel2007');\r\n    $excelTpl = $excelObjSource->load('template.xlsx');\r\n\r\n    $objWorkSheetBase = $excelTpl->getSheet();\r\n\r\n    $excelNewSheet = clone $objWorkSheetBase;\r\n    $excelNewSheet->setTitle('Copied sheet 1');\r\n    $excelNewSheet->setCellValue('A1', 'Sheet 1');\r\n\r\n    //  Attach the newly-cloned sheet to the $objPHPExcel workbook\r\n    $excelTpl->addSheet($excelNewSheet);\r\n\r\n    // Save the file to disk\r\n    $objWriter = PHPExcel_IOFactory::createWriter($excelTpl, 'Excel2007');\r\n    $objWriter->save('outputTest.xlsx');\r\n\r\n```\r\n\r\nChanging the first two lines to this (and saving my template as an xls file) works fine.\r\n```\r\n    $excelObjSource = PHPExcel_IOFactory::createReader('Excel5');\r\n    $excelTpl = $excelObjSource->load('template.xls');\r\n```\r\n\r\nSo, I have a workaround that I can use, but I've beat my head against my keyboard for a few days trying to figure this out and am hoping someone knows what I'm doing wrong or if I've stumbled on an obscure bug. I even tried creating the template in Office 2007, 2010, 2013, and 2016 - all with the same results. I thought it was something wrong with my source template file, so I tried starting with a completely empty XLSX file, but got the same results there too."}}