Saving Workbook as Xls changes values in some cells

Hi

I have an Excel workbook from a client. They are complaining that when this workbook is saved as an Excel 2003 format, some values in certain cells have changed to some completely different number.

I have attached the original workbook. To reproduce the issue, open the workbook with Aspose and Save as Excel 2003. If you take a look at cell J165 you'll notice that the value is different from the original file.

The version of Aspose is 5.2.2.3.

I have a newer version of Aspose where I cannot reproduce the issue however, our client is using a version of our software that contain Aspose version 5.2.2.3. They would like to know why the values have changed when saving as Excel 2003 as this is quite concerning.

Thanks

Harry

Hi,


It’s the bug (converting double value to RK value) of the old version. We had fixed this bug since 5.3.0


MS Excel 2003 used RK value to store double value in order to reduce the file .

An RK value is an encoded integer or floating-point value. RK values have a size of 4 bytes and are used to decrease file size for floating-point values.


Structure of an RK value (32-bit value), BIFF3-BIFF8:


Bit Mask Contents

0 00000001H 0 = Value not changed 1 = Value is multiplied by 100

1 00000002H 0 = Floating-point value 1 = Signed integer value

31-2 FFFFFFFCH Encoded value


If bit 1 is cleared, the encoded value represents the 30 most significant bits of an IEEE 754 floating-point value (64-bit double precision). The 34 least significant bits must be set to zero. If bit 1 is set, the encoded value represents a signed 30-bit integer value. To get the correct integer, the encoded value has to be shifted right arithmetically by 2 bits. If bit 0 is set, the decoded value (both integer and floating-point) must be divided by 100 to get the final result.

Thanks for you quick response.

How come this bug would only affect some numbers and not all?

Hi,


As we told you it was a bug in older version e.g v5.2.2 and we requested you to kindly upgrade to v5.3.0 in which we actually fixed that issue. We hope, your license could allow to use that version as well i.e. v5.3.0.

Thank you.

Yes, I understand that it is fixed in the later version as I mentioned in my original message that I could not reproduce the issue in a later version.

I was just curious to know why this issue only occurs for some values and not all values on the worksheet.

Hi,

Yes, you got a valid point.

Not all cells have same floating point values and since RK structure was not completely understood back then, there values were treated as they are and values were not decoded. Some cells’ encoded and decoded values are same, while other cells’ encoded and decoded values are different, that’s why it could work for some of the cells and fails for others.