> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/framework/externals/projects/openxml.md).

# OpenXml (openxml)

OpenXml 项目的能力范围、部署产物、接入入口与使用边界。

提供显式工作簿和单元格操作，适合需要直接控制表格结构的程序。模型记录的归档流程可以同时参考 ClosedXml 项目。

| 项目项  | 值                                            |
| ---- | -------------------------------------------- |
| 源码目录 | `externals/openxml`                          |
| 主包   | `Zongsoft.Externals.OpenXml`                 |
| 配套主题 | [表格与模板扩展](/framework/externals/documents.md) |

## 部署与使用入口

将主包追加到已有宿主的[部署清单](/references/deploy-files.md)，并保留包中的插件清单、程序集及附属运行资源：

{% code title="Application.deploy（追加片段）" %}

```ini
[plugins zongsoft externals openxml]
nuget:Zongsoft.Externals.OpenXml
```

{% endcode %}

直接使用项目中的 SpreadsheetDocument 包装器创建或打开工作簿。专题提供创建工作簿、写入单元格并保存的短示例。

## 接入步骤

1. 从创建一个工作表和两个单元格开始，保存后重新打开检查值。
2. 编辑已有文件时显式使用 editable 参数；默认打开方式为只读。
3. 验证中文、数据类型、所需格式及释放后文件能否再次访问。

具体配置、调用示例和相关基础概念见[表格与模板扩展](/framework/externals/documents.md)。

## 项目边界

{% hint style="info" %}
💡 包装器不会启动 Excel，也不会计算公式。公式缓存、图表等能力应按底层实现验证；调用者创建的工作簿要及时释放，以关闭底层文件包。
{% endhint %}

## 继续阅读

[按项目浏览扩展](/framework/externals/projects.md) · [表格与模板扩展](/framework/externals/documents.md) · [源码与项目说明](https://github.com/Zongsoft/framework/tree/main/externals/openxml)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/framework/externals/projects/openxml.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
