api_name | api_type | ms.assetid | title | ms.suite | ms.author | author | ms.topic | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
124cb0a0-cc47-433f-bad0-06b793890650 |
How to: Get worksheet information from an Open XML package |
office |
o365devx |
o365devx |
conceptual |
01/03/2024 |
high |
This topic shows how to use the classes in the Open XML SDK for Office to programmatically retrieve information from a worksheet in a Spreadsheet document.
[!includeStructure]
After you have opened the file for read-only access, you instantiate the Sheets class.
You then you iterate through the Sheets collection and display OpenXmlElement and the OpenXmlAttribute in each element.
By displaying the attribute information you get the name and ID for each worksheet in the spreadsheet file.
The following is the complete code sample in both C# and Visual Basic.