SharePoint列表中的Excel附件已损坏

时间:2018-07-23 17:07:13

标签: excel sharepoint attachment formulas corrupt


我的应用程序创建Excel文件并将其作为附件保存在SharePoint联机列表中。
这些文件包含一些公式,其中一些公式调用Excel文件中定义的VBA函数。
使用CSOM和如下代码创建并上传到SharePoint Online后,文件将不再修改:

AttachmentCreationInformation AttachInfo = new AttachmentCreationInformation();
AttachInfo.FileName = AttachFile;
AttachInfo.ContentStream = InStream;
Attached = Item.AttachmentFiles.Add(AttachInfo);
Context.Load(Attached, a => a.ServerRelativeUrl);
Context.ExecuteQuery();

通常这可以正常工作,但是在极少数情况下,当我尝试在本地Excel中打开附件时,我得到的消息是Excel文件已损坏,并且在按“修复”后,它将打开所有包含以下内容的公式:缺少本地VBA功能。
恢复公式并保存Excel文件时,可以再次打开它而没有任何错误。
以前,我是在本地使用SharePoint的,根本没有这个问题。
有谁知道何时何地发生这种情况?

0 个答案:

没有答案