尝试解决错误时出现 xlsx 错误:“已删除记录:来自 /xl/workbook.xml 部分的命名范围”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18539267/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xlsx error: "Removed Records: Named range from /xl/workbook.xml part" when tried to resolve errors
提问by trailblazer
I have an xlsx file that I generate using SSIS. The data to this file is written through a data flow task where the xlsx file is the oledb destination. I have used the following connection string as an expression for the OLEDB connection:
我有一个使用 SSIS 生成的 xlsx 文件。写入此文件的数据是通过数据流任务写入的,其中 xlsx 文件是 oledb 目标。我使用以下连接字符串作为 OLEDB 连接的表达式:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ @[User::ExcelPath] +";
Extended Properties=\"Excel 12.0 Xml;HDR=YES\";"
The file opens just fine before the data flow task. After the data flow task, I get a dialog as follows:
该文件在数据流任务之前打开得很好。在数据流任务之后,我得到一个对话框,如下所示:


When I click yes, I get another message:

当我单击是时,我收到另一条消息:

The contents of the xml file are
xml文件的内容是
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <logFileName>error072840_02.xml</logFileName><summary>Errors were detected in file 'C:\output\documentId-1.xlsx'</summary><removedRecords summary="Following is a list of removed records:"><removedRecord>Removed Records: Named range from /xl/workbook.xml part (Workbook)</removedRecord></removedRecords></recoveryLog>
I am not able to figure out what exactly is causing this error. Any help will be appreciated. TIA
我无法弄清楚究竟是什么导致了这个错误。任何帮助将不胜感激。TIA
采纳答案by trailblazer
Got it resolved. I don't really know the reason. Did some research and came to know that something related to tab names can cause this issue. I had to tabs with names like 'tab' and 'tab(2)'. May be possible that xlsx treats them as same names.
得到了解决。我真的不知道原因。做了一些研究,发现与标签名称相关的东西会导致这个问题。我不得不使用诸如“tab”和“tab(2)”之类的名称来标记。xlsx 可能将它们视为相同的名称。
回答by t_plusplus
I had this issue when I was using EPPlus to customise an existing template. For me the issue was in the template itself as it contained invalid references to lookup tables. I found this in Formula -> Name Manager.
我在使用 EPPlus 自定义现有模板时遇到了这个问题。对我来说,问题出在模板本身,因为它包含对查找表的无效引用。我在公式 -> 名称管理器中找到了这个。
I suggest that you check the template if you face this issue.
如果您遇到此问题,我建议您检查模板。
回答by Michael Brennt
In my case similar error was caused by sheet (tab) name longer than 30 characters.
在我的情况下,类似的错误是由超过 30 个字符的工作表(标签)名称引起的。
回答by idthappy
Maybe a special character in your tab name and you define name range with the tab name. such as tab name is "A(1)", just change it to "A(1)"
标签名称中可能有一个特殊字符,您可以使用标签名称定义名称范围。例如标签名称是“A(1)”,只需将其更改为“A(1)”
回答by George Grainger
For me personally, spaces/special characters were irrelevant in the tab (Sheet) names. The named range itself cannot have spaces/special characters as it is treated like a variable
就我个人而言,空格/特殊字符在选项卡(工作表)名称中无关紧要。命名范围本身不能有空格/特殊字符,因为它被视为变量
回答by Thomas
For me it was a button with a macro assigned with a value like : 'MyMacro("MyParam")'
对我来说,这是一个带有宏分配的按钮,其值类似于:'MyMacro("MyParam")'

