interop - COMException(0x80004005):幻灯片(未知成员):InsertFromFile 方法中抛出失败
问题描述
我正在使用Microsoft Interop library
. 通过 Interop 库方法将幻灯片添加到演示文稿时会引发标题异常。
文件存在,路径正确,索引有效。
inpPre.Slides.InsertFromFile(tmpPathInsert, inpSldCom.SlideIndex);
此代码可以正常工作,以进行大量演示,并在特定幻灯片上引发异常。错误:
System.Runtime.InteropServices.COMException (0x80004005): Slides (unknown member) : Failed.
at Microsoft.Office.Interop.PowerPoint.Slides.InsertFromFile(String FileName, Int32 Index, Int32 SlideStart, Int32 SlideEnd)
关于为什么会发生这种情况的任何想法?
解决方案
The PowerPoint that the file path is pointing to does not exist. Be sure to check the path and make sure it's pointing to the file you want to use. I recommend following the path exactly to see where it leads and make sure the file exists there.
推荐阅读
- c# - 是否获取组件
() 在 T 扩展类上工作? - arrays - 将一组图像上传到 Firebase 存储
- c# - 如何将当前 var 分配给 else 语句以便能够比较 var 值,然后将其保存以获得结果?
- ios - Flutter iOS 应用程序在启动时显示白屏并在该屏幕上挂断
- google-chrome - Headless Chrome 79 无法从 Windows 上的 Google Fonts 加载字体
- redux - 如何在路由更改后更改 redux 状态
- react-native-android - Expo SDK 需要 Expo 才能运行。看来是本地人
- python - 是否需要将数据分成三份;训练、验证和测试?
- artifactory - 使用 JFrog 访问 SAP NPM 存储库失败
- java - java.lang.NumberFormatException:Android 中的空字符串