This project has moved. For the latest updates, please go here.

Calculate total column width from a range

Dec 3, 2013 at 10:04 PM
Edited Dec 4, 2013 at 9:55 AM

What would be the easiest way to calculate the total column with from a range (example A1:H10)?
I have seen xlsx examples with the open xml tool, which defines only two columns. How can i calculate the width of the other ones which are not defined as a column element?

Here is an example:
<x:cols xmlns:x="">
  <x:col min="2" max="4" width="17.85546875" customWidth="1" />
Column 2 to 4 have 125 pixel length. But if i want to calculate column width from column 1 to 5, how is that possible?
Do i have to consider the page setup to calculate the total width and then subtract those elements from it?

The main goal would be to fit an image into a cell range (example A1:H10). To fullfill this task i have to evaluate the total column width and the total row height. Then i can use these two to create an image with the given pixel size.