Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excel xml window width property

This answer is strangely vacant from the internet, or my google-fu is getting rusty.

I'm making an excel file from C# via xml... When it loads up the worksheet width is pitifully small. Using <ss:WindowWidth>13395</ss:WindowWidth> as prescribed by the internet does... nothing. (edit: tried this in excelworkbook and worksheetoptions, if that gives any idea to the problem) Tried with and without the ss: additions. Also, I cannot seem to find exactly why everyone uses values with this in and around the tens of thousands.

I'm thoroughly confused. If someone links a LMGTFY that answers this I'll eat my hat, because I damn well don't see it.

Silly excel. No one likes you.

Just for you L. Figured windowWidth would give the jist of it.

enter image description here

like image 565
Remm Avatar asked Jul 25 '11 19:07

Remm


1 Answers

I've seen some people add an ExcelWorkbook element to the 'Workbook' element. The ExcelWorkbook element has WindowWidth and WindowHeight elements.

Here is an example that lists (all?) of the child elements for the ExcelWorkbook element.

<Workbook>
   <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
      <WindowHeight>6795</WindowHeight>
      <WindowWidth>8460</WindowWidth>
      <WindowTopX>120</WindowTopX>
      <WindowTopY>15</WindowTopY>
      <ProtectStructure>False</ProtectStructure>
      <ProtectWindows>False</ProtectWindows>
   </ExcelWorkbook>
   ...
</Workbook>

EDIT

The WindowWidth element is an unsigned int that is specified in twips. Twips is defined as a twentieth of a point.

Twips Link http://en.wikipedia.org/wiki/Twip

like image 140
Brian Dishaw Avatar answered Oct 23 '22 17:10

Brian Dishaw