Setup: Open Excel 2007, set the width of the first column to 15.0 (110 px), the height of the first row to 30.0 (40 px), split the widow pane in four at the first cell, and save the file.
When you open the file with the Open XML SDK 2.0 Productivity Tool the column width is “15.7109375” and the height is “30”, yet the xSplit value is “2040” and the ySplit value is “795”.
Can someone please explain how can I convert “15.0” to “110 px” to “15.7109375 width” to “2040 xSplit” for columns, and “30.0” to “40 px” to “30 ht” to “795 ySplit” for rows?
How can I calculate these numbers and convert from one to the other?
I recently had to work this out on an open source project so I thought that I’d post an answer here to help anyone else who encounters the same problem.
The calculation for the internal column width is documented in the ECMA-376 Part 1 and elsewhere.
The internal row height is the same as the height shown in the Excel interface.
The split pane xSplit and ySplit dimensions are the tricky ones. I didn’t find any specific documentation on how they are calculated apart from the fact that they are in units of 1/20 of a point. The calculations for these I deduced from interpolated data extracted from xlsx files and from similar calculations used in the xls file format.
Here is an example in Perl that demonstrates the calculations:
The output from this is:
Note, the ySplit value isn’t the same as the value in your question. However it does correlate with values extracted from several sample xlsx files that I tried. Perhaps, your sample file was using a different default font height.