OpenXML SDK 2.5 Excel文件损坏 [英] OpenXML SDK 2.5 Excel File Corruption

查看:274
本文介绍了OpenXML SDK 2.5 Excel文件损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用OpenXML SDK 2.5时遇到了一个问题,当您在列z之后填充单元格(所有在同一行上)时,无法打开电子表格而不会丢失数据。问题是在工作表的xml中,列引用AA,AB,AC等在单元格列表中的B列之前排序
。这样做的结果是写入了单元格A,AA,AB,AC等的数据,但是从恢复的电子表格中删除了单元格B到Z的数据。


创建一个空白电子表格(.xlsx),然后使用SDK将数据放入单元格A1,B1,C1,AA1,AB1,AC1。保存文件。


尝试在Excel中打开电子表格并收到文件基本上已损坏的消息。恢复电子表格并查看单元格A1,AA1,AB1和AC1中是否有数据,但缺少B1和C1中的数据。


如果您进入电子表格的xml内部并且将单元格AA及其后的结构移动到C列之后(在本例中),然后重新打开文件,没关系。


我目前正在通过启动电子表格来解决这个问题。 AA栏。



Mike

解决方案

嗨Mike,


>>创建空白电子表格(.xlsx) ,并使用SDK将数据放入单元格A1,B1,C1,AA1,AB1,AC1。保存文件。


如果您可以分享我们的代码,那么我们可能会尝试重现您的问题。


我建议您尝试使用适用于Microsoft Office的Open XML SDK 2.5生产力工具,打开文件并单击验证以检查是否存在是任何验证错误。


最好的问候,


爱德华


I've come across a problem in using the OpenXML SDK 2.5 where the spreadsheet cannot be opened without losing data when you fill cells past column z (all on the same row). The Issue is that in the xml for the sheet, column references AA, AB, AC, etc sort BEFORE column B in the cell list. The consequence of this is that the data for cells A, AA, AB, AC, etc is written, but the data for the cells B to Z is stripped out of the recovered spreadsheet.

Create a blank spreadsheet (.xlsx), and, using the SDK, put data into cells A1, B1, C1, AA1, AB1, AC1. Save the file.

Try to open the spreadsheet in excel and receive the message that the file is essentially corrupt. Recover the spreadsheet and see that there is data in cells A1, AA1, AB1 and AC1, but that in B1 and C1 is missing.

If you go into the xml internals of the spreadsheet and move the structures for cells AA and beyond to after that for column C (in this case) and then reopen the file, it's fine.

I am currently working around this by starting my spreadsheet in column AA.

Mike

解决方案

Hi Mike,

>>Create a blank spreadsheet (.xlsx), and, using the SDK, put data into cells A1, B1, C1, AA1, AB1, AC1. Save the file.

It would be helpful if you could share us your code, and then we could try to reproduce your issue.

I suggest you try Open XML SDK 2.5 Productivity Tool for Microsoft Office, open the file and click Validate to check whether there is any validation error.

Best Regards,

Edward


这篇关于OpenXML SDK 2.5 Excel文件损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆