c# - "The specified package is invalid. The main part is missing."在封闭的 XML 中

标签 c# excel openxml closedxml

我正在使用 closed XML用于生成 excel 模板。在生成的excel中填入数据后,我正在尝试用数据导入excel。它返回错误“指定的包无效。缺少主要部分。” .我正在使用 XLSX 文件。

try
 {
      var   workbook = new XLWorkbook(FILE_PATH);
}
catch (Exception ex)
{   
         throw;
}

使用生成的 excel 模板创建 XLWOrkbook 的对象时抛出错误。

请提供解决方案,

提前致谢...

最佳答案

我明白了。我的文件格式为“Strict Open XML Spreadsheet”。我已经变成了“Excel Workbook”。它可能对您有用。

关于c# - "The specified package is invalid. The main part is missing."在封闭的 XML 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27855377/

相关文章:

Django:将对象从数据库导出到Excel

c# - EPPlus 绑定(bind)后不计算公式输出

c# - 在 Excel 中更改 CellValue 中文本的字体颜色 - OpenXml

c# - Odata DataContext 仅更新修改的属性

c# - TDD 和继承

excel - 使用 ag 网格在 Angular2 上渲染 excel 表

excel - 逻辑解析 Excel 中的字符串以修剪附近的重复项

c# - OpenXml 数据透视表 : how do you read the total and subtotals in order to display them?

c# - 这在 C# 中可能吗?

c# - Leadtools.Codecs.dll 中发生类型为 'Leadtools.RasterException' 的未处理异常