Share via


Workbook クラス

定義

ブック。

このクラスは、Office 2007 以降で使用できます。

オブジェクトを xml としてシリアル化されるときに、修飾名は x:workbook です。

[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))]
[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
[DocumentFormat.OpenXml.SchemaAttr(22, "workbook")]
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
[DocumentFormat.OpenXml.SchemaAttr(22, "workbook")]
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
[DocumentFormat.OpenXml.SchemaAttr("x:workbook")]
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
[DocumentFormat.OpenXml.SchemaAttr("x:workbook")]
public class Workbook : DocumentFormat.OpenXml.TypedOpenXmlPartRootElement
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))]
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))]
[DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)]
public class Workbook : DocumentFormat.OpenXml.OpenXmlPartRootElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))>]
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
[<DocumentFormat.OpenXml.SchemaAttr(22, "workbook")>]
type Workbook = class
    inherit OpenXmlPartRootElement
type Workbook = class
    inherit OpenXmlPartRootElement
[<DocumentFormat.OpenXml.SchemaAttr(22, "workbook")>]
type Workbook = class
    inherit OpenXmlPartRootElement
[<DocumentFormat.OpenXml.SchemaAttr("x:workbook")>]
type Workbook = class
    inherit OpenXmlPartRootElement
[<DocumentFormat.OpenXml.SchemaAttr("x:workbook")>]
type Workbook = class
    inherit TypedOpenXmlPartRootElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))>]
type Workbook = class
    inherit OpenXmlPartRootElement
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileVersion))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileSharing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Office2013.ExcelAc.AbsolutePath), DocumentFormat.OpenXml.FileFormatVersions.Office2013)>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookProtection))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.BookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.Sheets))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FunctionGroups))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.ExternalReferences))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.DefinedNames))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CalculationProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.OleSize))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.CustomWorkbookViews))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.PivotCaches))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishing))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.FileRecoveryProperties))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WebPublishObjects))>]
[<DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Spreadsheet.WorkbookExtensionList))>]
[<DocumentFormat.OpenXml.OfficeAvailability(DocumentFormat.OpenXml.FileFormatVersions.Office2007)>]
type Workbook = class
    inherit OpenXmlPartRootElement
Public Class Workbook
Inherits OpenXmlPartRootElement
Public Class Workbook
Inherits TypedOpenXmlPartRootElement
継承
継承
属性

次のコード例では、既存のスプレッドシート ドキュメントを開き、"mySheet" という名前の新しいワークシートを追加し、ブックに関連付けます。

using System;  
using System.Linq;  
using DocumentFormat.OpenXml.Packaging;  
using DocumentFormat.OpenXml.Spreadsheet;  

namespace WorkbookEx  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            string fileName = @"C:\Users\Public\Documents\WorkbookEx.xlsx";  
            // Open an existing spreadsheet document for editing.  
            using (SpreadsheetDocument spreadSheet = SpreadsheetDocument.Open(fileName, true))  
            {  
                // Add a blank WorksheetPart.  
                WorksheetPart newWorksheetPart = spreadSheet.WorkbookPart.AddNewPart<WorksheetPart>();  
                newWorksheetPart.Worksheet = new Worksheet(new SheetData());  

                // Create a Sheets object in the Workbook.  
                Sheets sheets = spreadSheet.WorkbookPart.Workbook.GetFirstChild<Sheets>();  
                string relationshipId = spreadSheet.WorkbookPart.GetIdOfPart(newWorksheetPart);  

                // Create a unique ID for the new worksheet.  
                uint sheetId = 1;  
                if (sheets.Elements<Sheet>().Count() > 0)  
                {  
                    sheetId = sheets.Elements<Sheet>().Select(s => s.SheetId.Value).Max() + 1;  
                }  

                // Give the new worksheet a name.  
                string sheetName = "mySheet" + sheetId;  

                // Append the new worksheet and associate it with the workbook.  
                Sheet sheet = new Sheet() { Id = relationshipId, SheetId = sheetId, Name = sheetName };  
                sheets.Append(sheet);  
            }  
            Console.WriteLine("All done. Press a key.");  
            Console.ReadKey();  
        }  
    }  
}  
Imports System.Linq  
Imports DocumentFormat.OpenXml.Packaging  
Imports DocumentFormat.OpenXml.Spreadsheet  
Module Module1  
    Sub Main()  
        Dim fileName As String = "C:\Users\Public\Documents\WorkbookEx.xlsx"  
        ' Open an existing spreadsheet document for editing.  
        Dim spreadSheet As SpreadsheetDocument = SpreadsheetDocument.Open(fileName, True)  
        Using (spreadSheet)  
            ' Add a blank WorksheetPart.  
            Dim newWorksheetPart As WorksheetPart = spreadSheet.WorkbookPart.AddNewPart(Of WorksheetPart)()  
            newWorksheetPart.Worksheet = New Worksheet(New SheetData())  

            ' Create a Sheets object.  
            Dim sheets As Sheets = spreadSheet.WorkbookPart.Workbook.GetFirstChild(Of Sheets)()  
            Dim relationshipId As String = spreadSheet.WorkbookPart.GetIdOfPart(newWorksheetPart)  

            ' Get a unique ID for the new worksheet.  
            Dim sheetId As UInteger = 1  
            If (sheets.Elements(Of Sheet).Count > 0) Then  
                sheetId = sheets.Elements(Of Sheet).Select(Function(s) s.SheetId.Value).Max + 1  
            End If  

            ' Give the new worksheet a name.  
            Dim sheetName As String = ("mySheet" + sheetId.ToString())  

            ' Append the new worksheet and associate it with the workbook.  
            Dim sheet As Sheet = New Sheet  
            sheet.Id = relationshipId  
            sheet.SheetId = sheetId  
            sheet.Name = sheetName  
            sheets.Append(sheet)  
        End Using  
        Console.WriteLine("All done. Press a key.")  
        Console.ReadKey()  
    End Sub  
End Module  

注釈

[ISO/IEC 29500-1 1st Edition]

ブック (ブック)

workbook 要素は最上位の要素です。 これには、ブックのデータ コンテンツを含む要素と属性が含まれています。 ブックの子要素にはそれぞれ独自のサブクラウス参照があり、これらは下の子要素の表に示されています。 これらの要素が表すブックの構造の部分的なリストは次のとおりです。

  • シート: ブック内のワークシートのコレクションを表します。 シートはブック内の中央構造であり、ブックのテキスト、数値、日付、数式、およびその他の要素が含まれています。

  • ビュー: SpreadsheetML は、ブックがスプレッドシート アプリケーションによって表示される場合に、ブックの基本的なウィンドウの寸法と位置を定義するブック ビューのコレクションを定義します。 また、SpreadsheetML がブック内のデータの 1 つ以上のビューを記述できるようにする、カスタム ブック ビューのコレクションも定義します。

  • プロパティ: ブックには、使用する日付システム、ファイル保護設定、計算設定、スマート タグの動作など、ブックの基本的な設定を格納する複数のプロパティ コレクションがあります。

  • 名前: セル、セルの範囲、数式、または定数値を表す文字の単語または文字列。

[例:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>  
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/5/main" mlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">  
  <fileVersion lastEdited="4" lowestEdited="4" rupBuild="4017"/>  
  <workbookPr dateCompatibility="false" vbName="ThisWorkbook" defaultThemeVersion="123820"/>  
  <bookViews>  
    <workbookView xWindow="120" yWindow="45" windowWidth="15135"      windowHeight="7650" activeTab="4"/>  
  </bookViews>  
  <sheets>  
    <sheet name="Sheet1" sheetId="1" r:id="rId1"/>  
    <sheet name="Sheet2" sheetId="2" r:id="rId2"/>  
    <sheet name="Sheet5" sheetId="3" r:id="rId3"/>  
    <sheet name="Chart1" sheetId="4" type="chartsheet" r:id="rId4"/>  
  </sheets>  
  <definedNames>  
    <definedName name="MyDefinedName">Sheet3!$A$1:$C$12</definedName>  
  </definedNames>  
  <calcPr calcId="122211" calcMode="autoNoTable" refMode="R1C1" iterate="1"    fullPrecision="0"/>  
  <customWorkbookViews>  
    <customWorkbookView name="CustomView1"       guid="{CE6681F1-E999-414D-8446-68A031534B57}" maximized="1" xWindow="1"       yWindow="1" windowWidth="1024" windowHeight="547" activeSheetId="1"/>  
  </customWorkbookViews>  
  <pivotCaches>  
    <pivotCache cacheId="0" r:id="rId8"/>  
  </pivotCaches>  
  <smartTagPr embed="1" show="noIndicator"/>  
  <smartTagTypes>  
    <smartTagType namespaceUri="urn:schemas-openxmlformats-org:office:smarttags"       name="date"/>  
  </smartTagTypes>  
  <webPublishing codePage="1252"/>  
</workbook>  

例終わり]

親の要素
SpreadsheetML ブック パーツのルート要素
子要素 Subclause
bookViews (ブック ビュー) §18.2.1
calcPr (計算プロパティ) §18.2.2
customWorkbookViews (カスタム ブック ビュー) §18.2.4
definedNames (Defined Names) §18.2.6
externalReferences (外部参照) §18.2.9
extLst (Future Feature Data Storage Area) §18.2.10
fileRecoveryPr (ファイルの回復プロパティ) §18.2.11
fileSharing (ファイル共有) §18.2.12
fileVersion (ファイル バージョン) §18.2.13
functionGroups (関数グループ) §18.2.15
oleSize (埋め込みオブジェクト サイズ) §18.2.16
pivotCaches (PivotCaches) §18.2.18
シート (シート) §18.2.20
smartTagPr (スマート タグのプロパティ) §18.2.21
smartTagTypes (スマート タグの種類) §18.2.23
webPublishing (Web 発行プロパティ) §18.2.24
webPublishObjects (Web Publish オブジェクト) §18.2.26
workbookPr (ブックのプロパティ) §18.2.28
workbookProtection (Workbook Protection) §18.2.29

[: この要素のコンテンツ モデル (CT_Workbook) の W3C XML スキーマ定義は§A.2 にあります。 メモの終了]

ISO/IEC29500: 2008。

コンストラクター

Workbook()

Workbook クラスの新しいインスタンスを初期化します。

Workbook(IEnumerable<OpenXmlElement>)

指定した子要素を使用して Workbook クラスの新しいインスタンスを初期化します。

Workbook(OpenXmlElement[])

指定した子要素を使用して Workbook クラスの新しいインスタンスを初期化します。

Workbook(String)

外部 XML から Workbook クラスの新しいインスタンスを初期化します。

プロパティ

AbsolutePath

AbsolutePath、このプロパティは Office 2013 以降でのみ使用できます。

スキーマの要素タグ x15ac:absPath を表します。

BookViews

BookViews。

スキーマの x:bookViews の要素タグを表します。

CalculationProperties

CalculationProperties。

スキーマ内の x:calcPr 要素タグを表します。

ChildElements

現在の要素のすべての子ノードを取得します。

(継承元 OpenXmlElement)
Conformance

適合 性

スキーマ内の次の属性を表します。準拠

CustomWorkbookViews

CustomWorkbookViews。

スキーマの x:customWorkbookViews の要素タグを表します。

DefinedNames

DefinedNames。

スキーマの x:definedNames 要素タグを表します。

ExtendedAttributes

現在の要素のすべての拡張属性 (スキーマで定義されていない属性) を取得します。

(継承元 OpenXmlElement)
ExternalReferences

ExternalReferences。

スキーマの要素タグ x:externalReferences を表します。

Features

現在の要素の を IFeatureCollection 取得します。 この機能コレクションは読み取り専用ですが、使用可能な場合は親パーツとパッケージから機能を継承します。

(継承元 OpenXmlElement)
FileSharing

FileSharing。

スキーマ内の x:fileSharing 要素タグを表します。

FileVersion

FileVersion。

スキーマの x:fileVersion 要素タグを表します。

FirstChild

現在の OpenXmlElement 要素の最初の子を取得します。

(継承元 OpenXmlCompositeElement)
FunctionGroups

FunctionGroups。

スキーマの x:functionGroups 要素タグを表します。

HasAttributes

現在の要素に属性があるかどうかを示す値を取得します。

(継承元 OpenXmlElement)
HasChildren

現在の要素に子要素があるかどうかを示す値を取得します。

(継承元 OpenXmlCompositeElement)
InnerText

現在のノードとそのすべての子の連結値を取得または設定します。

(継承元 OpenXmlCompositeElement)
InnerXml

現在のノードの子ノードのみを表すマークアップを取得または設定します。

(継承元 OpenXmlCompositeElement)
LastChild

現在の OpenXmlElement 要素の最後の子を取得します。 このような OpenXmlElement 要素がない場合は、null (Visual Basic では Nothing) を返します。

(継承元 OpenXmlCompositeElement)
LocalName

ブック。

このクラスは、Office 2007 以降で使用できます。

オブジェクトを xml としてシリアル化されるときに、修飾名は x:workbook です。

LocalName

現在の要素のローカル名を取得します。

(継承元 OpenXmlElement)
MCAttributes

マークアップ互換性属性を取得または設定します。 現在の要素に対してマークアップ互換性属性が定義されていない場合は null を返します。

(継承元 OpenXmlElement)
NamespaceDeclarations

現在の要素で定義されているすべての名前空間宣言を取得します。 名前空間宣言がない場合は、空の列挙子を返します。

(継承元 OpenXmlElement)
NamespaceUri

現在の要素の名前空間 URI を取得します。

(継承元 OpenXmlElement)
OleSize

OleSize。

スキーマの x:oleSize 要素タグを表します。

OpenXmlElementContext

現在の要素の OpenXmlElementContext を取得します。

(継承元 OpenXmlElement)
OpenXmlPart

DOM ツリーに関連付けられているパーツを取得します。 DOM ツリーがパーツに関連付けられていない場合、null が返されます。

(継承元 OpenXmlPartRootElement)
OuterXml

現在の要素とそのすべての子要素を表すマークアップを取得します。

(継承元 OpenXmlElement)
Parent

現在の要素の親要素を取得します。

(継承元 OpenXmlElement)
PivotCaches

PivotCaches。

スキーマ内の x:pivotCaches 要素タグを表します。

Prefix

現在の要素の名前空間プレフィックスを取得します。

(継承元 OpenXmlElement)
Sheets

シート。

スキーマ内の次の要素タグを表します: x:sheets。

WebPublishing

WebPublishing。

スキーマ内の x:webPublishing 要素タグを表します。

WorkbookPart

この要素に関連付けられている WorkbookPart を取得します。

WorkbookProperties

WorkbookProperties。

スキーマ内の次の要素タグを表します: x:workbookPr。

WorkbookProtection

WorkbookProtection。

スキーマの x:workbookProtection 要素タグを表します。

XmlQualifiedName

現在の要素の修飾名を取得します。

(継承元 OpenXmlElement)
XName

現在の要素の修飾名を取得します。

(継承元 OpenXmlElement)

メソッド

AddAnnotation(Object)

現在の OpenXmlElement 要素の注釈の一覧にオブジェクトを追加します。

(継承元 OpenXmlElement)
AddChild(OpenXmlElement, Boolean)

指定した要素が既知の子である場合は、 要素に追加します。 これにより、 要素がスキーマに従って正しい場所に追加されます。

(継承元 OpenXmlCompositeElement)
AddNamespaceDeclaration(String, String)

現在のノードに名前空間宣言を追加します。

(継承元 OpenXmlElement)
Ancestors()

現在の要素のすべての先祖を列挙します。

(継承元 OpenXmlElement)
Ancestors<T>()

指定した型を持つ現在の要素の先祖のみを列挙します。

(継承元 OpenXmlElement)
Annotation(Type)

現在の OpenXmlElement 要素から、指定した型の最初の注釈オブジェクトを取得します。

(継承元 OpenXmlElement)
Annotation<T>()

現在の OpenXmlElement 要素から、指定した型の最初の注釈オブジェクトを取得します。

(継承元 OpenXmlElement)
Annotations(Type)

現在の OpenXmlElement 要素の指定した型を持つ注釈のコレクションを取得します。

(継承元 OpenXmlElement)
Annotations<T>()

現在の OpenXmlElement 要素の指定した型を持つ注釈のコレクションを取得します。

(継承元 OpenXmlElement)
Append(IEnumerable<OpenXmlElement>)

要素のリストから現在の要素の子要素のリストの末尾に各要素を追加します。

(継承元 OpenXmlElement)
Append(OpenXmlElement[])

要素の配列から、現在の要素の子要素のリストの末尾に各要素を追加します。

(継承元 OpenXmlElement)
AppendChild<T>(T)

現在の要素の子ノードのリストの末尾に、指定した要素を追加します。

(継承元 OpenXmlCompositeElement)
ClearAllAttributes()

既知の属性と拡張属性の両方を含むすべての属性をクリアします。

(継承元 OpenXmlElement)
Clone()

現在のノードの複製を作成します。

(継承元 OpenXmlElement)
CloneNode(Boolean)

このノードの複製を作成します。

Descendants()

現在の要素のすべての子孫を列挙します。

(継承元 OpenXmlElement)
Descendants<T>()

T 型のすべての現在の要素の子孫を列挙します。

(継承元 OpenXmlElement)
Elements()

現在の要素のすべての子を列挙します。

(継承元 OpenXmlElement)
Elements<T>()

指定した型を持つ現在の要素の子のみを列挙します。

(継承元 OpenXmlElement)
ElementsAfter()

現在の要素に続き、現在の要素と同じ親を持つすべての兄弟要素を列挙します。

(継承元 OpenXmlElement)
ElementsBefore()

現在の要素の前にあり、現在の要素と同じ親を持つすべての兄弟要素を列挙します。

(継承元 OpenXmlElement)
GetAttribute(String, String)

指定したタグ名と名前空間 URI を持つ Open XML 属性を取得します。

(継承元 OpenXmlElement)
GetAttributes()

すべての属性のコピーを含むリストを取得します。

(継承元 OpenXmlElement)
GetEnumerator()

子コレクションを反復処理する列挙子を返します。

(継承元 OpenXmlElement)
GetFirstChild<T>()

T 型の最初の子要素を検索します。

(継承元 OpenXmlElement)
InsertAfter<T>(T, OpenXmlElement)

指定した参照要素の直後に、指定した要素を挿入します。

(継承元 OpenXmlCompositeElement)
InsertAfterSelf<T>(T)

現在の要素の直後に、指定した要素を挿入します。

(継承元 OpenXmlElement)
InsertAt<T>(T, Int32)

現在の要素の子の指定したインデックス位置に、指定した要素を挿入します。

(継承元 OpenXmlCompositeElement)
InsertBefore<T>(T, OpenXmlElement)

指定した参照要素の直前に、指定した要素を挿入します。

(継承元 OpenXmlCompositeElement)
InsertBeforeSelf<T>(T)

現在の要素の直前に、指定した要素を挿入します。

(継承元 OpenXmlElement)
IsAfter(OpenXmlElement)

指定した要素の後に現在の要素がドキュメントの順序で表示されるかどうかを判断します。

(継承元 OpenXmlElement)
IsBefore(OpenXmlElement)

指定した要素の前に現在の要素がドキュメントの順序で表示されるかどうかを判断します。

(継承元 OpenXmlElement)
Load(WorkbookPart)

WorkbookPart から DOM を読み込む

LookupNamespace(String)

現在のノードのコンテキストの名前空間プレフィックスを解決します。

(継承元 OpenXmlElement)
LookupPrefix(String)

現在の要素スコープ内の名前空間 URI の対応するプレフィックスを検索します。

(継承元 OpenXmlElement)
NextSibling()

現在の OpenXmlElement 要素の直後にある OpenXmlElement 要素を取得します。 次の OpenXmlElement 要素がない場合は null (Visual Basic では Nothing) を返します。

(継承元 OpenXmlElement)
NextSibling<T>()

現在の OpenXmlElement 要素に続く指定した型を持つ OpenXmlElement 要素を取得します。 次の OpenXmlElement がない場合は、null (Visual Basic では Nothing) を返します。

(継承元 OpenXmlElement)
PrependChild<T>(T)

現在の要素の子ノードのリストの先頭に、指定した要素を挿入します。

(継承元 OpenXmlCompositeElement)
PreviousSibling()

現在の OpenXmlElement 要素のすぐ前にある OpenXmlElement 要素を取得します。 前に OpenXmlElement 要素がない場合は、null (Visual Basic では Nothing) を返します。

(継承元 OpenXmlElement)
PreviousSibling<T>()

現在の OpenXmlElement の前に指定された型を持つ OpenXmlElement 要素を取得します。 前に OpenXmlElement 要素がない場合は null (Visual Basic では Nothing) を返します。

(継承元 OpenXmlElement)
Reload()

Open XML DOM ツリーにパーツ コンテンツを再読み込みします。 このメソッドは複数回呼び出すことができます。呼び出されるたびに、ツリーが再読み込みされ、ツリーの以前の変更は破棄されます。

(継承元 OpenXmlPartRootElement)
Remove()

現在の要素を親から削除します。

(継承元 OpenXmlElement)
RemoveAllChildren()

現在の要素のすべての子要素を削除します。

(継承元 OpenXmlCompositeElement)
RemoveAllChildren<T>()

T 型の現在の要素の子要素をすべて削除します。

(継承元 OpenXmlElement)
RemoveAnnotations(Type)

指定した型の注釈を現在の OpenXmlElement 要素から削除します。

(継承元 OpenXmlElement)
RemoveAnnotations<T>()

指定した型の注釈を現在の OpenXmlElement 要素から削除します。

(継承元 OpenXmlElement)
RemoveAttribute(String, String)

現在の要素から 属性を削除します。

(継承元 OpenXmlElement)
RemoveChild<T>(T)

指定した子要素を削除します。

(継承元 OpenXmlCompositeElement)
RemoveNamespaceDeclaration(String)

指定したプレフィックスの名前空間宣言を削除します。 プレフィックスがない場合は、何も削除しません。

(継承元 OpenXmlElement)
ReplaceChild<T>(OpenXmlElement, T)

現在の要素の子要素の 1 つを別の OpenXmlElement 要素に置き換えます。

(継承元 OpenXmlCompositeElement)
Save()

DOM ツリー内のデータをパーツに保存します。 このメソッドは複数回呼び出すことができますが、呼び出されるたびにストリームがフラッシュされます。

(継承元 OpenXmlPartRootElement)
Save(Stream)

DOM ツリーを指定されたストリームに保存します。

(継承元 OpenXmlPartRootElement)
Save(WorkbookPart)

DOM を WorkbookPart に保存します。

SetAttribute(OpenXmlAttribute)

指定した要素に属性を設定します。 属性が既知の属性の場合、属性の値が設定されます。 属性が拡張属性の場合は、拡張属性リストに 'openxmlAttribute' が追加されます。

(継承元 OpenXmlElement)
SetAttributes(IEnumerable<OpenXmlAttribute>)

要素に複数の属性を設定します。 属性が既知の属性の場合、属性の値が設定されます。 属性が拡張属性の場合は、拡張属性リストに 'openxmlAttribute' が追加されます。

(継承元 OpenXmlElement)
WriteTo(XmlWriter)

現在のノードを指定した XmlWriter に保存します。

(継承元 OpenXmlPartRootElement)

明示的なインターフェイスの実装

IEnumerable.GetEnumerator()

ブック。

このクラスは、Office 2007 以降で使用できます。

オブジェクトを xml としてシリアル化されるときに、修飾名は x:workbook です。

(継承元 OpenXmlElement)
IEnumerable<OpenXmlElement>.GetEnumerator()

子コレクションを反復処理する列挙子を返します。

(継承元 OpenXmlElement)

適用対象