setCellValueExplicit Excel 5?

Topics: User Forum
Mar 13, 2008 at 9:27 AM
Hello,

I created a script like this:

session_start();

$definedpathphp_excel = "classes/";
requireonce("".$definedpathphpexcel."PHPExcel.php");
requireonce("".$definedpathphpexcel."PHPExcel/Writer/Excel2007.php");


// Create new PHPExcel object
$objPHPExcel = new PHPExcel();

// Set properties
$objPHPExcel->getProperties()->setCreator("".$_SESSION'Naam'."");
$objPHPExcel->getProperties()->setLastModifiedBy("".$_SESSION'Naam'."");
$objPHPExcel->getProperties()->setTitle("Rapport aangemaakt door RGR");
$objPHPExcel->getProperties()->setSubject("Rapport aangemaakt door RGR");
$objPHPExcel->getProperties()->setDescription("Rapport aangemaakt door RGR");
$objPHPExcel->getProperties()->setKeywords("Rapport");
$objPHPExcel->getProperties()->setCategory("Rapport registersynchronisatie");
//Einde set properties

$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Hello');
$objPHPExcel->getActiveSheet()->setCellValue('B2', "".$_SESSION'Naam'."");
$objPHPExcel->getActiveSheet()->setCellValue('C1', 'Hello');
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'world!');
$objPHPExcel->getActiveSheet()->setCellValueExplicit('A3', '871694840000112222333333','s');


$objPHPExcel->getActiveSheet()->setTitle('rapport');
$objPHPExcel->setActiveSheetIndex(0);
$objWriter = new PHPExcelWriterExcel2007($objPHPExcel);
$objWriter->save("rapportages/05featuredemo.xlsx");

?>

In Excel 2007 this works.
But when I change the script to be used with Excel 5 the cell A3 does not show the correct number as text.

How do I change this?
I need Excel 5...
Coordinator
Mar 17, 2008 at 11:31 AM
Edited Mar 17, 2008 at 11:32 AM
The underlying Excel writer (PEARspreadsheetExcel) does not support this.