Share via


WorkbookProperties Class

Definition

Defines the WorkbookProperties Class.

This class is available in Office 2007 and above.

When the object is serialized out as xml, it's qualified name is x:workbookPr.

[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
[DocumentFormat.OpenXml.SchemaAttr(22, "workbookPr")]
public class WorkbookProperties : DocumentFormat.OpenXml.OpenXmlLeafElement
public class WorkbookProperties : DocumentFormat.OpenXml.OpenXmlLeafElement
[DocumentFormat.OpenXml.SchemaAttr(22, "workbookPr")]
public class WorkbookProperties : DocumentFormat.OpenXml.OpenXmlLeafElement
[DocumentFormat.OpenXml.SchemaAttr("x:workbookPr")]
public class WorkbookProperties : DocumentFormat.OpenXml.OpenXmlLeafElement
[DocumentFormat.OpenXml.SchemaAttr("x:workbookPr")]
public class WorkbookProperties : DocumentFormat.OpenXml.TypedOpenXmlLeafElement
[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
public class WorkbookProperties : DocumentFormat.OpenXml.OpenXmlLeafElement
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
[<DocumentFormat.OpenXml.SchemaAttr(22, "workbookPr")>]
type WorkbookProperties = class
    inherit OpenXmlLeafElement
type WorkbookProperties = class
    inherit OpenXmlLeafElement
[<DocumentFormat.OpenXml.SchemaAttr(22, "workbookPr")>]
type WorkbookProperties = class
    inherit OpenXmlLeafElement
[<DocumentFormat.OpenXml.SchemaAttr("x:workbookPr")>]
type WorkbookProperties = class
    inherit OpenXmlLeafElement
[<DocumentFormat.OpenXml.SchemaAttr("x:workbookPr")>]
type WorkbookProperties = class
    inherit TypedOpenXmlLeafElement
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
type WorkbookProperties = class
    inherit OpenXmlLeafElement
Public Class WorkbookProperties
Inherits OpenXmlLeafElement
Public Class WorkbookProperties
Inherits TypedOpenXmlLeafElement
Inheritance
Inheritance
Attributes

Remarks

[ISO/IEC 29500-1 1st Edition]

workbookPr (Workbook Properties)

This element defines a collection of workbook properties.

[Example:

<workbookPr dateCompatibility="false" showObjects="none" saveExternalLinkValues="0"  defaultThemeVersion="123820"/>  

end example]

Parent Elements
workbook (§18.2.27)
Attributes Description
allowRefreshQuery (Allow Refresh Query) Specifies a boolean value that indicates whether the application will refresh query tables in this workbook.

A value of 1 or true indicates the application will refresh query tables when the workbook is loaded.

A value of 0 or false indicates the application will not refresh query tables.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
autoCompressPictures (Auto Compress Pictures) Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.

A value of 1 or true indicates the application automatically compresses pictures of the workbook. When a picture is compressed, the application:

- Reduces resolution (to 96 dots per inch (dpi) for Web and 200 dpi for print), and unnecessary information is discarded.
- Discards extra information. [Example: When a picture has been cropped or resized, the "hidden" parts of the picture are stored in the file. end example]
- Compress the picture, if possible.

A value of 0 or false indicates the application does not compress pictures in this workbook.

The default value for this attribute is true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
backupFile (Create Backup File) Specifies a boolean value that indicates whether the application creates a backup of the workbook on save.

A value of 1 or true indicates the application creates a backup of the workbook on save.

A value of 0 or false indicates the application does not create a backup.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
checkCompatibility (Check Compatibility On Save) Specifies a boolean value that indicates whether the application checks for compatibility when saving this workbook to older file formats.

A value of 1 or true indicates the application performs a compatibility check when saving to legacy binary formats.

A value of 0 or false indicates the application does not perform a compatibility check when saving to legacy binary formats.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
codeName (Code Name) Specifies the codename of the application that created this workbook. Use this attribute to track file content in incremental releases of the application.

The possible values for this attribute are defined by the W3C XML Schema string datatype.
date1904 (Date 1904) Value that indicates whether to use a 1900 or 1904 date base when converting serial values in the workbook to dates. [Note: If the dateCompatibility attribute is 0 or false, this attribute is ignored. end note]

A value of 1 or true indicates the workbook uses the 1904 backward compatibility date system.

A value of 0 or false indicates the workbook uses a date system based in 1900, as specified by the value of the dateCompatibility attribute.

(See §18.17.4.1 for the definition of the date bases.)

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
dateCompatibility (Date Compatibility) Specifies whether the date base should be treated as a compatibility date base or should support the full 8601 date range.

A value of 1 or true indicates that the date system in use is either the 1900 backward compatibility date base or the 1904 backward compatibility date base, as specified by the value of the date1904 attribute.

A value of 0 or false indicates that the date system is the 1900 date base, based on the 8601 date range.

(See §18.17.4.1 for the definition of the date bases.)

The default value for this attribute is true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
defaultThemeVersion (Default Theme Version) Specifies the default version of themes to apply in the workbook.

The value for defaultThemeVersion depends on the application. SpreadsheetML defaults to the form [version][build], where [version] refers to the version of the application, and [build] refers to the build of the application when the themes in the user interface changed.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.
filterPrivacy (Filter Privacy) Specifies a boolean value that indicates whether the application has inspected the workbook for personally identifying information (). If this flag is set, the application warns the user any time the user performs an action that will insert into the document. [Example: Inserting a comment might insert the user's name. end example]

A value of 1 or true indicates the application will warn the user when they insert into the workbook.

A value of 0 or false indicates the application will not warn the user when they insert into the workbook; the workbook has not been inspected for .

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
hidePivotFieldList (Hide Pivot Field List) Specifies a boolean value that indicates whether a list of fields is shown for pivot tables in the application user interface.

A value of 1 or true indicates a list of fields is show for pivot tables.

A value of 0 or false indicates a list of fields is not shown for pivot tables.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
promptedSolutions (Prompted Solutions) Specifies a boolean value that indicates whether the user has received an alert to load Smart Document components.

A value of 1 or true indicates the user received an alert to load SmartDoc.

A value of 0 or false indicates the user did not receive an alert.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
publishItems (Publish Items) Specifies a boolean value that indicates whether the publish the workbook or workbook items to the application server.

A value of 1 or true indicates that workbook items are published.

A value of 0 or false indicates that the workbook is published.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
refreshAllConnections (Refresh all Connections on Open) Specifies a boolean value that indicates whether the workbok shall refresh all the connections to data sources during load.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
saveExternalLinkValues (Save External Link Values) Specifies a boolean value that indicates whether the application will cache values retrieved from other workbooks via an externally linking formula. Data is cached at save.

A value of 1 or true indicates data from externally linked formulas is cached. A supporting part is written out containing a cached cell table from the external workbook.

A value of 0 or false indicates data from externally linked formulas is not cached.

The default value for this attribute is true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
showBorderUnselectedTables (Show Border Unselected Table) Specifies a boolean value that indicates whether a border is drawn around unselected tables in the workbook.

A value of 1 or true indicates borders are drawn around unselected tables.

A value of 0 or false indicates borders are not drawn around unselected tables.

The default value for this attribute is true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
showInkAnnotation (Show Ink Annotations) Specifies a boolean value that indicates whether the book shows ink annotations.

A value of 1 or true indicates that ink annotations are shown in the workbook.

A value of 0 or false indicates that ink annotations are not shown in the workbook.

The default value for this attribute is true.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
showObjects (Show Objects) Specifies how the application shows embedded objects in the workbook.

This attribute it optional.

The default value for this attribute is "all."

The possible values for this attribute are defined by the ST_Objects simple type (§18.18.48).
showPivotChartFilter (Show Pivot Chart Filter) Specifies a boolean value that indicates whether filtering options are shown for pivot charts in the workbook.

A value of 1 or true indicates filtering options shall be shown for pivot charts.

A value of 0 or false indicates filtering options shall not be shown.

The default value for this attribute is false.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.
updateLinks (Update Links Behavior) Specifies how the application updates external links when the workbook is opened.

The default value for this attribute is userSet.

The possible values for this attribute are defined by the ST_UpdateLinks simple type (§18.18.87).

[Note: The W3C XML Schema definition of this element’s content model (CT_WorkbookPr) is located in §A.2. end note]

� ISO/IEC29500: 2008.

Constructors

WorkbookProperties()

Initializes a new instance of the WorkbookProperties class.

Properties

AllowRefreshQuery

Allow Refresh Query

Represents the following attribute in the schema: allowRefreshQuery

AutoCompressPictures

Auto Compress Pictures

Represents the following attribute in the schema: autoCompressPictures

BackupFile

Create Backup File

Represents the following attribute in the schema: backupFile

CheckCompatibility

Check Compatibility On Save

Represents the following attribute in the schema: checkCompatibility

ChildElements

Gets all the child nodes of the current element.

(Inherited from OpenXmlElement)
CodeName

Code Name

Represents the following attribute in the schema: codeName

Date1904

Date 1904

Represents the following attribute in the schema: date1904

DateCompatibility

dateCompatibility, this property is only available in Office 2010 and later.

Represents the following attribute in the schema: dateCompatibility

DefaultThemeVersion

Default Theme Version

Represents the following attribute in the schema: defaultThemeVersion

ExtendedAttributes

Gets all extended attributes (attributes not defined in the schema) of the current element.

(Inherited from OpenXmlElement)
Features

Gets a IFeatureCollection for the current element. This feature collection will be read-only, but will inherit features from its parent part and package if available.

(Inherited from OpenXmlElement)
FilterPrivacy

Filter Privacy

Represents the following attribute in the schema: filterPrivacy

FirstChild

Gets the first child of the OpenXmlElement element. Returns null (Nothing in Visual Basic) if there is no such OpenXmlElement element.

(Inherited from OpenXmlElement)
HasAttributes

Gets a value indicating whether the current element has any attributes.

(Inherited from OpenXmlElement)
HasChildren

Gets a value that indicates whether the current element has any child elements.

(Inherited from OpenXmlLeafElement)
HidePivotFieldList

Hide Pivot Field List

Represents the following attribute in the schema: hidePivotFieldList

InnerText

Gets or sets the concatenated values of the node and all of its children.

(Inherited from OpenXmlElement)
InnerXml

Gets or sets the markup that only represents child elements of the current element.

(Inherited from OpenXmlLeafElement)
LastChild

Gets the last child of the OpenXmlElement element. Returns null (Nothing in Visual Basic) if there is no such OpenXmlElement element.

(Inherited from OpenXmlElement)
LocalName
LocalName

Gets the local name of the current element.

(Inherited from OpenXmlElement)
MCAttributes

Gets or sets the markup compatibility attributes. Returns null if no markup compatibility attributes are defined for the current element.

(Inherited from OpenXmlElement)
NamespaceDeclarations

Gets all the namespace declarations defined in the current element. Returns an empty enumerator if there is no namespace declaration.

(Inherited from OpenXmlElement)
NamespaceUri

Gets the namespace URI of the current element.

(Inherited from OpenXmlElement)
OpenXmlElementContext

Gets the OpenXmlElementContext of the current element.

(Inherited from OpenXmlElement)
OuterXml

Gets the markup that represents the current element and all of its child elements.

(Inherited from OpenXmlElement)
Parent

Gets the parent element of the current element.

(Inherited from OpenXmlElement)
Prefix

Gets the namespace prefix of current element.

(Inherited from OpenXmlElement)
PromptedSolutions

Prompted Solutions

Represents the following attribute in the schema: promptedSolutions

PublishItems

Publish Items

Represents the following attribute in the schema: publishItems

RefreshAllConnections

Refresh all Connections on Open

Represents the following attribute in the schema: refreshAllConnections

SaveExternalLinkValues

Save External Link Values

Represents the following attribute in the schema: saveExternalLinkValues

ShowBorderUnselectedTables

Show Border Unselected Table

Represents the following attribute in the schema: showBorderUnselectedTables

ShowInkAnnotation

Show Ink Annotations

Represents the following attribute in the schema: showInkAnnotation

ShowObjects

Show Objects

Represents the following attribute in the schema: showObjects

ShowPivotChartFilter

Show Pivot Chart Filter

Represents the following attribute in the schema: showPivotChartFilter

UpdateLinks

Update Links Behavior

Represents the following attribute in the schema: updateLinks

XmlQualifiedName

Gets the qualified name of the current element.

(Inherited from OpenXmlElement)
XName

Gets the qualified name of the current element.

(Inherited from OpenXmlElement)

Methods

AddAnnotation(Object)

Adds an object to the current OpenXmlElement element's list of annotations.

(Inherited from OpenXmlElement)
AddNamespaceDeclaration(String, String)

Adds a namespace declaration to the current node.

(Inherited from OpenXmlElement)
Ancestors()

Enumerates all of the current element's ancestors.

(Inherited from OpenXmlElement)
Ancestors<T>()

Enumerates only the current element's ancestors that have the specified type.

(Inherited from OpenXmlElement)
Annotation(Type)

Get the first annotation object of the specified type from the current OpenXmlElement element.

(Inherited from OpenXmlElement)
Annotation<T>()

Get the first annotation object of the specified type from the current OpenXmlElement element.

(Inherited from OpenXmlElement)
Annotations(Type)

Gets a collection of annotations with the specified type for the current OpenXmlElement element.

(Inherited from OpenXmlElement)
Annotations<T>()

Gets a collection of annotations with the specified type for the current OpenXmlElement element.

(Inherited from OpenXmlElement)
Append(IEnumerable<OpenXmlElement>)

Appends each element from a list of elements to the end of the current element's list of child elements.

(Inherited from OpenXmlElement)
Append(OpenXmlElement[])

Appends each element from an array of elements to the end of the current element's list of child elements.

(Inherited from OpenXmlElement)
AppendChild<T>(T)

Appends the specified element to the end of the current element's list of child nodes.

(Inherited from OpenXmlElement)
ClearAllAttributes()

Clears all of the attributes, including both known attributes and extended attributes.

(Inherited from OpenXmlElement)
Clone()

Creates a duplicate of the current node.

(Inherited from OpenXmlElement)
CloneNode(Boolean)

Creates a duplicate of this node.

Descendants()

Enumerates all of the current element's descendants.

(Inherited from OpenXmlElement)
Descendants<T>()

Enumerate all of the current element's descendants of type T.

(Inherited from OpenXmlElement)
Elements()

Enumerates all of the current element's children.

(Inherited from OpenXmlElement)
Elements<T>()

Enumerates only the current element's children that have the specified type.

(Inherited from OpenXmlElement)
ElementsAfter()

Enumerates all of the sibling elements that follow the current element and have the same parent as the current element.

(Inherited from OpenXmlElement)
ElementsBefore()

Enumerates all of the sibling elements that precede the current element and have the same parent as the current element.

(Inherited from OpenXmlElement)
GetAttribute(String, String)

Gets an Open XML attribute with the specified tag name and namespace URI.

(Inherited from OpenXmlElement)
GetAttributes()

Gets a list that contains a copy of all the attributes.

(Inherited from OpenXmlElement)
GetEnumerator()

Returns an enumerator that iterates through the child collection.

(Inherited from OpenXmlElement)
GetFirstChild<T>()

Finds the first child element in type T.

(Inherited from OpenXmlElement)
InsertAfter<T>(T, OpenXmlElement)

Inserts the specified element immediately after the specified reference element.

(Inherited from OpenXmlElement)
InsertAfterSelf<T>(T)

Inserts the specified element immediately after the current element.

(Inherited from OpenXmlElement)
InsertAt<T>(T, Int32)

Inserts the specified element at the specified index in the current element's list of child elements.

(Inherited from OpenXmlElement)
InsertBefore<T>(T, OpenXmlElement)

Inserts the specified element immediately before the specified reference element.

(Inherited from OpenXmlElement)
InsertBeforeSelf<T>(T)

Inserts the specified element immediately before the current element.

(Inherited from OpenXmlElement)
IsAfter(OpenXmlElement)

Determines if the current element appears after a specified element in document order.

(Inherited from OpenXmlElement)
IsBefore(OpenXmlElement)

Determines if the current element appears before a specified element in document order.

(Inherited from OpenXmlElement)
LookupNamespace(String)

Resolves the namespace prefix in the context of the current node.

(Inherited from OpenXmlElement)
LookupPrefix(String)

Finds the corresponding prefix for a namespace uri in the current element scope.

(Inherited from OpenXmlElement)
NextSibling()

Gets the OpenXmlElement element that immediately follows the current OpenXmlElement element. Returns null (Nothing in Visual Basic) if there is no next OpenXmlElement element.

(Inherited from OpenXmlElement)
NextSibling<T>()

Gets the OpenXmlElement element with the specified type that follows the current OpenXmlElement element. Returns null (Nothing in Visual Basic) if there is no next OpenXmlElement.

(Inherited from OpenXmlElement)
PrependChild<T>(T)

Inserts the specified element at the beginning of the current element's list of child elements.

(Inherited from OpenXmlElement)
PreviousSibling()

Gets the OpenXmlElement element that immediately precedes the current OpenXmlElement element. Returns null (Nothing in Visual Basic ) if there is no preceding OpenXmlElement element.

(Inherited from OpenXmlElement)
PreviousSibling<T>()

Gets the OpenXmlElement element with the specified type that precedes the current OpenXmlElement. Returns null (Nothing in Visual Basic) if there is no preceding OpenXmlElement element.

(Inherited from OpenXmlElement)
Remove()

Removes the current element from its parent.

(Inherited from OpenXmlElement)
RemoveAllChildren()

Removes all child elements of the current element.

(Inherited from OpenXmlLeafElement)
RemoveAllChildren<T>()

Remove all of the current element's child elements that are of type T.

(Inherited from OpenXmlElement)
RemoveAnnotations(Type)

Removes the annotations of the specified type from the current OpenXmlElement element.

(Inherited from OpenXmlElement)
RemoveAnnotations<T>()

Removes the annotations with the specified type from the current OpenXmlElement element.

(Inherited from OpenXmlElement)
RemoveAttribute(String, String)

Removes the attribute from the current element.

(Inherited from OpenXmlElement)
RemoveChild<T>(T)

Removes the specified child element from the current element's list of child elements.

(Inherited from OpenXmlElement)
RemoveNamespaceDeclaration(String)

Removes the namespace declaration for the specified prefix. Removes nothing if there is no prefix.

(Inherited from OpenXmlElement)
ReplaceChild<T>(OpenXmlElement, T)

Replaces a child element with another child element in the current element's list of child elements.

(Inherited from OpenXmlElement)
SetAttribute(OpenXmlAttribute)

Sets an attribute to the specified element. If the attribute is a known attribute, the value of the attribute is set. If the attribute is an extended attribute, the 'openxmlAttribute' is added to the extended attributes list.

(Inherited from OpenXmlElement)
SetAttributes(IEnumerable<OpenXmlAttribute>)

Sets a number of attributes to the element. If an attribute is a known attribute, the value of the attribute is set. If an attribute is an extended attribute, the 'openxmlAttribute' is added to the extended attributes list.

(Inherited from OpenXmlElement)
WriteTo(XmlWriter)

Saves the current node to the specified XmlWriter.

(Inherited from OpenXmlElement)

Explicit Interface Implementations

IEnumerable.GetEnumerator() (Inherited from OpenXmlElement)
IEnumerable<OpenXmlElement>.GetEnumerator()

Returns an enumerator that iterates through the child collection.

(Inherited from OpenXmlElement)

Applies to