You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to-get-worksheet-information-from-a-package.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ The following assembly directives are required to compile the code in this topic
37
37
38
38
## Create SpreadsheetDocument object
39
39
40
-
In the Open XML SDK, the **[SpreadsheetDocument](/dotnet/api/documentformat.openxml.packaging.spreadsheetdocument?view=openxml-2.8.1)** class represents an Excel document package. To create an Excel document, you create an instance of the **SpreadsheetDocument** class and populate it with parts. At a minimum, the document must have a workbook part that serves as a container for the document, and at least one worksheet part. The text is represented in the package as XML using **SpreadsheetML** markup.
40
+
In the Open XML SDK, the **[SpreadsheetDocument](/dotnet/api/documentformat.openxml.packaging.spreadsheetdocument?)** class represents an Excel document package. To create an Excel document, you create an instance of the **SpreadsheetDocument** class and populate it with parts. At a minimum, the document must have a workbook part that serves as a container for the document, and at least one worksheet part. The text is represented in the package as XML using **SpreadsheetML** markup.
41
41
42
42
To create the class instance from the document you call one of the **[Open](/dotnet/api/documentformat.openxml.packaging.spreadsheetdocument.open.md)** methods. In this example, you must open the file for read access only. Therefore, you can use the **[Open(String, Boolean)](dotnet/api/documentformat.openxml.packaging.spreadsheetdocument.open?view=openxml-2.8.1&preserve-view=true #DocumentFormat_OpenXml_Packaging_SpreadsheetDocument_Open_System_String_System_Boolean_)** method, and set the Boolean parameter to **false**.
43
43
@@ -57,9 +57,9 @@ The **using** statement provides a recommended alternative to the typical .Open,
57
57
58
58
## Basic structure of a SpreadsheetML
59
59
60
-
The basic document structure of a **SpreadsheetML** document consists of the **[Sheets](dotnet/api/documentformat.openxml.spreadsheet.sheets?view=openxml-2.8.1&preserve-view=true)** and **[Sheet](dotnet/api/documentformat.openxml.spreadsheet.sheet?view=openxml-2.8.1&preserve-view=true)** elements, which reference the
61
-
worksheets in the **[Workbook](dotnet/api/documentformat.openxml.spreadsheet.workbook?view=openxml-2.8.1&preserve-view=true)**. A separate XML file is created
62
-
for each **[Worksheet](dotnet/api/documentformat.openxml.spreadsheet.worksheet?view=openxml-2.8.1&preserve-view=true)**. For example, the **SpreadsheetML** for a workbook that has two worksheets name MySheet1 and MySheet2 is located in the Workbook.xml file and is shown in the following code example.
60
+
The basic document structure of a **SpreadsheetML** document consists of the **[Sheets](/dotnet/api/documentformat.openxml.spreadsheet.sheets?view=openxml-2.8.1&preserve-view=true)** and **[Sheet](/dotnet/api/documentformat.openxml.spreadsheet.sheet?view=openxml-2.8.1&preserve-view=true)** elements, which reference the
61
+
worksheets in the **[Workbook](/dotnet/api/documentformat.openxml.spreadsheet.workbook?view=openxml-2.8.1&preserve-view=true)**. A separate XML file is created
62
+
for each **[Worksheet](/dotnet/api/documentformat.openxml.spreadsheet.worksheet?view=openxml-2.8.1&preserve-view=true)**. For example, the **SpreadsheetML** for a workbook that has two worksheets name MySheet1 and MySheet2 is located in the Workbook.xml file and is shown in the following code example.
@@ -71,7 +71,7 @@ for each **[Worksheet](dotnet/api/documentformat.openxml.spreadsheet.worksheet?v
71
71
</workbook>
72
72
```
73
73
74
-
The worksheet XML files contain one or more block level elements such as **SheetData**. **[SheetData](dotnet/api/documentformat.openxml.spreadsheet.sheetdata?view=openxml-2.8.1&preserve-view=true)** represents the cell table and contains one or more **[Row](dotnet/api/documentformat.openxml.spreadsheet.row?view=openxml-2.8.1&preserve-view=true)** elements. A **row** contains one or more **[Cell](dotnet/api/documentformat.openxml.spreadsheet.cell?view=openxml-2.8.1&preserve-view=true)** elements. Each cell contains a **[CellValue](dotnet/api/documentformat.openxml.spreadsheet.cellvalue?view=openxml-2.8.1&preserve-view=true)** element that represents the value of the cell. For example, the SpreadsheetML for the first worksheet in a workbook, that only has the value 100 in cell A1, is located in the Sheet1.xml file and is shown in the following code example.
74
+
The worksheet XML files contain one or more block level elements such as **SheetData**. **[SheetData](/dotnet/api/documentformat.openxml.spreadsheet.sheetdata?view=openxml-2.8.1&preserve-view=true)** represents the cell table and contains one or more **[Row](/dotnet/api/documentformat.openxml.spreadsheet.row?view=openxml-2.8.1&preserve-view=true)** elements. A **row** contains one or more **[Cell](/dotnet/api/documentformat.openxml.spreadsheet.cell?view=openxml-2.8.1&preserve-view=true)** elements. Each cell contains a **[CellValue](/dotnet/api/documentformat.openxml.spreadsheet.cellvalue?view=openxml-2.8.1&preserve-view=true)** element that represents the value of the cell. For example, the SpreadsheetML for the first worksheet in a workbook, that only has the value 100 in cell A1, is located in the Sheet1.xml file and is shown in the following code example.
75
75
76
76
```xml
77
77
<?xml version="1.0" encoding="UTF-8" ?>
@@ -112,7 +112,7 @@ After you have opened the file for read-only access, you instantiate the **Sheet
You then you iterate through the **Sheets** collection and display **[OpenXmlElement](dotnet/api/documentformat.openxml.openxmlelement?view=openxml-2.8.1&preserve-view=true)** and the **[OpenXmlAttribute](api/documentformat.openxml.openxmlattribute?view=openxml-2.8.1&preserve-view=true)** in each element.
115
+
You then you iterate through the **Sheets** collection and display **[OpenXmlElement](/dotnet/api/documentformat.openxml.openxmlelement?view=openxml-2.8.1&preserve-view=true)** and the **[OpenXmlAttribute](/api/documentformat.openxml.openxmlattribute?view=openxml-2.8.1&preserve-view=true)** in each element.
0 commit comments