Escaping values when writing to excel

Topics: Developer Forum
Dec 19, 2012 at 3:56 PM

PHP Excel Version: 1.7.6, 2011-02-27
PHP Version: 5.3.19

I am using the below function to write data into cells. The problem I just ran into is that someone put data in one of the fields that was ========= which throws an error. Is there any sort of escape sequence that I need to pass the data through?

$this->format_SetCellValue("B", "360", "=========");

function format_SetCellValue($Column, $Row, $Value)    {
    $this->objPHPExcel->getActiveSheet()->SetCellValueByColumnAndRow($Column, $Row, $Value);
}

Dec 19, 2012 at 6:54 PM

If the first character is a "=", use setCellValueExplicitByColumnAndRow.

Dec 20, 2012 at 10:25 PM
Lwol wrote:

If the first character is a "=", use setCellValueExplicitByColumnAndRow.

 

So if the function format_SetCellValue is only used to write text to the cell (and no formulas) then should I always use setCellValueExplicitByColumnAndRow?