Home » File Formats » Spreadsheet_Excel_Writer » Bug #2261
Excel 2002 crashes when use write() with @ as first value of the text
Details
| Submitted | 2004-08-31 17:08 UTC |
|---|---|
| From | b-egner at t-online dot de |
| Assigned | progi1984 |
| Status | Closed |
| Package | Spreadsheet_Excel_Writer |
| PHP Version | Irrelevant |
| OS | Debian Woody |
| Roadmaps | (Not assigned) |
Comments
[2004-08-31 17:08 UTC] b-egner at t-online dot de
Description:
------------
Excel 2002 crashes when using worksheet::write() with @ as first value of the text
Example:
$worksheet->write("@test");
Result:
Excel 2002 (XP) crashes if you open an exported file...
Reproduce code:
---------------
$workbook = new Spreadsheet_Excel_Writer();
$workbook->send("test.xls");
$worksheet =& $workbook->addWorksheet("Mytitle");
$worksheet->write(0, 0, "@test"); // <-- Here's the "@"
$workbook->close();
Expected result:
----------------
- test.xls exported
- Opening with Excel 2002 shows in Column 0, 0 the value "@test"
Actual result:
--------------
- test.xls exported
- Opening with Excel 2002 will crash Excel
[2006-01-12 16:15 UTC] anicoll at dundeecity dot gov dot uk
I have similar problem. Using MS Excel 2000 with Verion 2.1 (I Think). Doesnt crash but passes what seems to be an error from the package through when I try to write a text string '@'. The value comes through to the spreadsheet as
"Syntax error: , lookahead: , current char: 0"
(my double quotes).
[2006-01-12 16:32 UTC] anicoll at dundeecity dot gov dot uk
Solved my problem by specifically calling the writeString() method rather than the generic write() method. The write() (I Think) matches anything beginning with an '@' to a Formula and proceeds to use the writeFormula() method behind the scenes.
I dont know if this helps with the problem causing a crash.