ExcelWorkbook Element (Microsoft Excel)

Contains the properties of a workbook.

Contained In

XML

Subelements

1904Date, ActiveChart, ActiveSheet, Calculation, CreateBackup, DisplayDrawingObjects, DoNotAcceptLabelsInFormulas, DoNotCalculateBeforeSave, DoNotSaveLinkValues, ExcelWorksheets, HideHorizontalScrollBar, HideVerticalScrollBar, HideWorkbookTabs, Iteration, MaxChange, MaxIterations, PrecisionAsDisplayed, ProtectStructure, ProtectWindows, RefModeR1C1, SelectedSheets, TabRatio, Uncalced, WindowHeight, WindowHidden, WindowIconic, WindowTopX, WindowTopY, WindowWidth

Remarks

The ExcelWorksheets subelement is required, but all other subelements are optional. The other subelements are not specified when the data comes from a PivotList component.

Example

This example specifies a workbook containing three worksheets. The workbook window is minimized. Sheet1 is split into four panes, Sheet2 is split into two panes, and Sheet3 is not split. The range B3:B7 in Sheet1 is selected. AutoFilter is enabled in Sheet2. The contents, objects, and scenarios of each worksheet, in addition to the structure and windows of the workbook, are not protected.


 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetOptions>
     <x:CodeName>Sheet1</x:CodeName>
     <x:TopRowVisible>11</x:TopRowVisible>
     <x:SplitHorizontal>3210</x:SplitHorizontal>
     <x:TopRowBottomPane>0</x:TopRowBottomPane>
     <x:SplitVertical>6195</x:SplitVertical>
     <x:LeftColumnRightPane>0</x:LeftColumnRightPane>
     <x:ActivePane>0</x:ActivePane>
     <x:Panes>
      <x:Pane>
       <x:Number>3</x:Number>
       <x:ActiveRow>2</x:ActiveRow>
       <x:ActiveCol>1</x:ActiveCol>
       <x:RangeSelection>B3:B7</x:RangeSelection>
      </x:Pane>
      <x:Pane>
       <x:Number>2</x:Number>
       <x:ActiveRow>11</x:ActiveRow>
      </x:Pane>
      <x:Pane>
       <x:Number>1</x:Number>
       <x:ActiveRow>15</x:ActiveRow>
       <x:ActiveCol>3</x:ActiveCol>
      </x:Pane>
      <x:Pane>
       <x:Number>0</x:Number>
       <x:ActiveRow>2</x:ActiveRow>
       <x:ActiveCol>1</x:ActiveCol>
       <x:RangeSelection>B3:B7</x:RangeSelection>
      </x:Pane>
     </x:Panes>
     <x:FreezePanes/>
     <x:GridlineColorIndex>32</x:GridlineColorIndex>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetOptions>
     <x:DefaultColumnWidth>12</x:DefaultColumnWidth>
     <x:DefaultRowHeight>12</x:DefaultRowHeight>
     <x:DisplayFormulas/>
     <x:DisplayRightToLeft/>
     <x:DoNotDisplayGridlines/>
     <x:FrozenNoSplit/>
     <x:NoSummaryColumnsRightDetail/>
     <x:NoSummaryRowsBelowDetail/>
     <x:Print>
      <x:ValidPrinterInfo/>
      <x:HorizontalResolution>204</x:HorizontalResolution>
      <x:VerticalResolution>196</x:VerticalResolution>
      <x:NumberOfCopies>0</x:NumberOfCopies>
     </x:Print>
     <x:CodeName>Sheet2</x:CodeName>
     <x:Selected/>
     <x:FilterOn/>
     <x:DisplayFormulas/>
     <x:DoNotDisplayGridlines/>
     <x:DoNotDisplayZeros/>
     <x:DoNotDisplayHeadings/>
     <x:DoNotDisplayOutline/>
     <x:SplitVertical>5910</x:SplitVertical>
     <x:LeftColumnRightPane>5</x:LeftColumnRightPane>
     <x:Panes>
      <x:Pane>
       <x:Number>3</x:Number>
      </x:Pane>
      <x:Pane>
       <x:Number>1</x:Number>
      </x:Pane>
     </x:Panes>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet3</x:Name>
    <x:WorksheetOptions>
     <x:CodeName>Sheet3</x:CodeName>
     <x:AlternateExpressionEvaluation/>
     <x:AlternateFormulaEntry/>
     <x:ApplyAutomaticOutlineStyles/>
     <x:ShowPageBreakZoom/>
     <x:PageBreakZoom>200</x:PageBreakZoom>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:WindowIconic/>
  <x:HideHorizontalScrollBar/>
  <x:HideVerticalScrollBar/>
  <x:HideWorkbookTabs/>
  <x:WindowHeight>8070</x:WindowHeight>
  <x:WindowWidth>13260</x:WindowWidth>
  <x:WindowTopX>240</x:WindowTopX>
  <x:WindowTopY>75</x:WindowTopY>
  <x:ActiveSheet>1</x:ActiveSheet>
  <x:DisplayDrawingObjects>PlaceHolders</x:DisplayDrawingObjects>
  <x:Calculation>ManualCalculation</x:Calculation>
  <x:DoNotCalculateBeforeSave/>
  <x:MaxIterations>400</x:MaxIterations>
  <x:MaxChange>0.05</x:MaxChange>
  <x:Date1904/>
  <x:RefModeR1C1/>
  <x:Iteration/>
  <x:PrecisionAsDisplayed/>
  <x:DoNotSaveLinkValues/>
  <x:AcceptLabelsInFormulas/>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
  <x:Uncalced/>
 </x:ExcelWorkbook>

The next example specifies a workbook containing 3 worksheets and an active chart sheet named MyChart. The workbook window is hidden. The 1904 date format is used and backups are created. However, labels are not allowed in formulas, values in linked cells are not saved, and the scroll bars and worksheet tabs are hidden. Iterations through circular references are tracked with 0.05 as the maximum change between iterations and 500 as the maximum number of iterations allowed. Calculations are not automatic, and the workbook is not calculated before it is saved.


 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet001.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet002.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet3</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet003.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>MyChart</x:Name>
    <x:WorksheetSource HRef="./book4_files/chart001.htm"/>
    <x:WorksheetType>Chart</x:WorksheetType>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:1904Date/>
  <x:ActiveChart>MyChart</x:ActiveChart>
  <x:CreateBackup/>
  <x:DoNotAcceptLabelsInFormulas/>
  <x:DoNotCalculateBeforeSave/>
  <x:DoNotSaveLinkValues/>
  <x:HideHorizontalScrollBar/>
  <x:HideVerticalScrollBar/>
  <x:HideWorkbookTabs/>
  <x:Iteration/>
  <x:MaxChange>0.05</x:MaxChange>
  <x:MaxIterations>500</x:MaxIterations>
  <x:Calculation>xlManual</x:Calculation>
  <x:Stylesheet HRef="./book4_files/stylesheet.css"/>
  <x:WindowHidden/>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
 </x:ExcelWorkbook>

The following example specifies a workbook containing three worksheets. All three worksheets are selected but Sheet2 is active. The 1904 date format is used, backups are created, and placeholders are displayed in place of drawing objects. Calculations are performed using only the precision of numbers as they are displayed. The workbook window is 13260 points wide by 8070 points high, and it is positioned 240 points from the left edge and 75 points from the top edge of the application window.


 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet001.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet002.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet3</x:Name>
    <x:WorksheetSource HRef="./book4_files/sheet003.htm"/>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:1904Date/>
  <x:CreateBackup/>
  <x:ActiveSheet>2</x:ActiveSheet/>
  <x:DisplayDrawingObjects>xlPlaceholders</x:DisplayDrawingObjects>
  <x:PrecisionAsDisplayed/>
  <x:SelectedSheets>3</x:SelectedSheets>
  <x:Stylesheet HRef="./book4_files/stylesheet.css"/>
  <x:WindowHeight>8070</x:WindowHeight>
  <x:WindowWidth>13260</x:WindowWidth>
  <x:WindowTopX>240</x:WindowTopX>
  <x:WindowTopY>75</x:WindowTopY>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
 </x:ExcelWorkbook>

The following example shows the WorksheetOptions element from sheet001.htm in the preceding example. The worksheet is selected, row 2 is the active row, and the range A3:A5 is selected. The contents, objects, and scenarios in this worksheet are protected.


 <x:WorksheetOptions>
  <x:CodeName>Sheet1</x:CodeName>
  <x:Selected/>
  <x:Panes>
   <x:Pane>
    <x:Number>3</x:Number>
    <x:ActiveRow>2</x:ActiveRow>
    <x:RangeSelection>A3:A5</x:RangeSelection>
   </x:Pane>
  </x:Panes>
  <x:ProtectContents>True</x:ProtectContents>
  <x:ProtectObjects>True</x:ProtectObjects>
  <x:ProtectScenarios>True</x:ProtectScenarios>
 </x:WorksheetOptions>

This example shows the WorksheetOptions element from sheet002.htm. In this case, the worksheet is hidden and not selected, the zoom level is 200%, column 2 is active, and the range A3:A5 is selected. The standard column width is 10 characters. The contents, objects, and scenarios in this worksheet are protected.


 <x:WorksheetOptions>
  <x:Zoom>200</x:Zoom>
  <x:Visible>SheetHidden</x:Visible>
  <x:CodeName>Sheet1</x:CodeName>
  <x:Panes>
   <x:Pane>
    <x:Number>3</x:Number>
   </x:Pane>
   <x:Pane>
    <x:Number>2</x:Number>
    <x:ActiveCol>2</x:ActiveCol>
    <x:RangeSelection>A3:A5</x:RangeSelection>
   </x:Pane>
  </x:Panes>
  <x:StandardWidth>10</x:StandardWidth>
  <x:ProtectContents>True</x:ProtectContents>
  <x:ProtectObjects>True</x:ProtectObjects>
  <x:ProtectScenarios>True</x:ProtectScenarios>
 </x:WorksheetOptions>