Fix some errors with samples

This commit is contained in:
Progi1984
2016-03-22 14:25:49 +01:00
parent 114fc00763
commit 6e222bbdde
99 changed files with 820 additions and 929 deletions
+4 -4
View File
@@ -35,12 +35,12 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
require_once dirname(__FILE__) . '/../src/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
$objPHPExcel = new \PHPExcel\Spreadsheet();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@@ -76,7 +76,7 @@ $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
$objPHPExcel->getActiveSheet()
->getStyle('A2:B2')
->getProtection()->setLocked(
PHPExcel_Style_Protection::PROTECTION_UNPROTECTED
\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED
);
@@ -88,7 +88,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;