【发布时间】:2015-03-18 05:50:19
【问题描述】:
对于MSDN,SpreadsheetML 文档的基本文档结构由 Sheets 和 Sheet 元素组成,它们引用工作簿中的工作表。
例如,有一个带有工作表的工作簿:
<workbook xmlns=http://schemas.openxmlformats.org/spreadsheetml/2006/main xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
<sheets>
<sheet name="MySheet1" sheetId="1" r:id="rId1" />
<sheet name="MySheet2" sheetId="2" r:id="rId2" />
</sheets>
</workbook>
还有两个工作表,例如:
<?xml version="1.0" encoding="UTF-8" ?>
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<sheetData>
<row r="1">
<c r="A1">
<v>100</v>
</c>
</row>
</sheetData>
</worksheet>
我的任务是通过工作表的名称获取工作表。 但我不明白 beetwen Sheet 和 Worksheet 的关系是什么。 好的,我在表格中找到了预期名称为“MySheet2”的表格,但我怎样才能获得合适的工作表? Worksheet 类没有名称属性或一些“外键”来与 Sheet 链接。
【问题讨论】:
标签: c# excel openxml openxml-sdk