Issue 8640 - Save as .xls writes incorrect cell format
Summary: Save as .xls writes incorrect cell format
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: PC Windows 98
: P2 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
: 13814 (view as issue list)
Depends on:
Reported: 2002-10-23 12:00 UTC by philhibbs
Modified: 2013-08-07 15:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Demo spreadsheet for Save As Excel cell format problem (5.60 KB, application/octet-stream)
2002-10-23 12:01 UTC, philhibbs
no flags Details
proposed patch (777 bytes, patch)
2003-01-17 14:44 UTC, john.marmion
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description philhibbs 2002-10-23 12:00:15 UTC
A cell that contains a formula such as =IF(C8="";"";IF(C8=$D$5;0;C8)), with 
Category=Number, Format=General, is written out as an .xls with 
Category=General if the source cell C8 contains a value, but Category=Text if 
C8 does not contain a value. This leads to any further calculations that 
reference the cell being incorrect, as Text cells are not considered to be 

I had previously been adding comments to Issue 5658, but I now believe that 
this is a separate issue with the Save As Excel 97 code. See the prh_demo.sxc 
attachment. If you save this as Excel, cell D7 remains as numeric, but D8 
changes to Text. If you then overtype B8 and D8, then E8 miscalculates 
(overtype B7 and D7 with the same values to see the correct result in E7).
Comment 1 philhibbs 2002-10-23 12:01:39 UTC
Created attachment 3306 [details]
Demo spreadsheet for Save As Excel cell format problem
Comment 2 daniel.rentz 2002-11-06 09:32:32 UTC
Very easy to reproduce:
In a new spreadsheet, type ="", and save to Excel.
Comment 3 daniel.rentz 2002-11-06 09:32:52 UTC
Comment 4 daniel.rentz 2003-01-13 17:01:47 UTC
Comment 5 john.marmion 2003-01-17 14:42:32 UTC
Accepting ownership of thois issue. Thanks to Daniel the proposed fix
turned out to be relatively simple.
Comment 6 john.marmion 2003-01-17 14:44:05 UTC
Created attachment 4327 [details]
proposed patch
Comment 7 john.marmion 2003-01-17 15:04:57 UTC
Checked in this fix today
Comment 8 john.marmion 2003-02-19 12:31:08 UTC
re-open to assign to QA
Comment 9 john.marmion 2003-02-19 12:31:47 UTC
re-assigning to QA
Comment 10 john.marmion 2003-02-19 12:32:47 UTC
re-setting to "fixed"
Comment 11 frank 2003-04-08 10:50:52 UTC
verified on cws calc06 using Windows and Solaris
Comment 12 frank 2003-04-16 15:03:28 UTC
found integrated on Solaris, Linux and Windows using srx644m10s1
Comment 13 daniel.rentz 2003-04-28 09:18:40 UTC
*** Issue 13814 has been marked as a duplicate of this issue. ***