I am trying to write a library in VB.net that can be used to write Excel
spread sheets directly form an application. My library will be writing the
sheets as XML files.
I need to be bale to give the user of the library a way to control column
width and am running into a bit of an odd quandary with regards to the value
used.
The Excel GUI seems to let you enter the column width as a factor of
characters (between 0 and 255) but when that number is stored in the sheet
it is not stored as that number but rather it is stored as (according to the
xmlss spec) points.
My library is allowing the user to enter the column width explicitly so I
have to decide how I want them to enter it in (as characters or points). I
would like to keep it as characters since this is what most Excel users are
already using in the GUI but then I need to convert it to points myself when
I store it to the file. This is where I am having a difficult time. I can't
seem to come up with any specific conversion formula that makes the numbers
work out.
Here is a small table showing my issue. The 'char' column is the value that
the user enters into the GUI and the 'points' column is how the value is
actually stored. These are REAL values taken from some tests I ran in my
effort to find the formula used to convert these numbers.
char points
-----------------
..1 .75
..2 1.5
..3 3.0
..4 3.75
..5 4.5
..6 5.25
..7 6
..8 7.5
..9 8.25
1 9
2 14.25
3 19.5
4 24.75
5 30
6 35.25
7 40.5
8 45.75
9 51
10 56.25
Can anyone here lend a hand as to the real conversion formula used here? I
am starting to think that I should just use a lookup table but I really
would like to not go in that direction if I don't have to. There HAS to be a
formula for this that I am just not able to find.
Thanks to all in advance...
PS. I am going to keep searching myself so if I happen to finid it I will be
sure to reply here
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14226
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/
Bookmarks