Microsoft KB Archive/328996

= The values that you save in an XML spreadsheet do not match the values that appear in Excel 2002 and in Excel 2003 =

Article ID: 328996

Article Last Modified on 2/1/2007

-

APPLIES TO


 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition

-



This article was previously published under Q328996







SYMPTOMS
When you save a spreadsheet in the XML Spreadsheet (XMLSS) format in Excel 2002, the numbers in the resulting XMLSS file may not match what appears in Excel 2002. Mismatched numbers also appear if you use the Range.Value method in Microsoft Visual Basic for Applications (VBA) with the xlRangeValueXMLSpreadsheet value or the xlRangeValueMSPersistXML value.

This article discusses why this problem can occur when you save a file in the XMLSS format.



CAUSE
This problem occurs because Microsoft Excel was designed around the IEEE (Institute of Electrical and Electronics Engineers) 754 specification regarding storing and calculating floating-point numbers. IEEE is an international body that, among other things, determines standards for computer software and hardware. The IEEE 754 specification is a very widely adopted specification that describes how floating-point numbers must be stored in a binary computer. It is popular because it permits floating-point numbers to be stored in a reasonable space and for calculations to occur relatively quickly.

When a file is saved in the XMLSS format, numbers are stored in the XMLSS file as floating-point numbers. When the file is re-opened in Excel, they appear as they were entered. However, if the XMLSS file is used by another program, they are imported as they appear in the XML tags. For additional information about how Excel stores numbers, click the following article number to view the article in the Microsoft Knowledge Base:

78113 Floating-point arithmetic may give inaccurate results



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
The following blocks of code are examples that would cause mismatched numbers unless the worksheet is structured correctly: Range(&quot;A1:A4&quot;).Value(xlRangeValueXMLSpreadsheet) and Range(&quot;A1:A4&quot;).Value(xlRangeValueMSPersistXML)

Additional query words: XL2002

Keywords: kbbug kbpending KB328996

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.