Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: .Net Excel 互操作删除工作表
我的 C 盘中有一个 EXCEL 文件。如何使用 c# 从该文件中删除其中一个工作表?
您可以通过将 Microsoft.Office.Interop 库添加到您的项目来与 Excel 进行互操作。您可以通过工作簿对象访问工作表并在指定索引上调用 delete。另外,记得之后做一些清理工作。我发现如果处理不当,Excel 喜欢在程序运行完成后在后台徘徊。