1.DSO Framer无法激活不可见或已禁用的控件
因为业务需求,执行了一次清空面板main_panel所有控件,之后未向窗体面板main_panel中添加过OfficeFramerControl,直接调用了OfficeFramerControl.Open();
OfficeFramerControl.Open("D:\\文件路径");
抛出异常
//System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>无法激活不可见或已禁用的控件</Message><StackTrace> 在 System.Windows.Forms.ContainerControl.SetActiveControlInternal(Control value)
//在 DSOFramer._FramerControl.Open(Object Document, Object ReadOnly, Object ProgId, Object WebUsername, Object WebPassword)</StackTrace><ExceptionString>System.ArgumentException: 无法激活不可见或已禁用的控件
//“System.Reflection.TargetInvocationException”类型的未经处理的异常在 mscorlib.dll 中发生调用的目标发生了异常。
将控件添加到面板后再调用打开方法,原代码改为:
main_panel.Controls.Add(OfficeFramerControl);
OfficeFramerControl.Open("D:\\文件路径");
2.COMException (0x80010001): 被呼叫方拒绝接收呼叫。
OfficeFramerControl.Open(“D:\文件路径”);
刚开始打开office时是正常的,试了几次之后突然开始抛出被呼叫方拒绝接收呼叫。
异常信息:
在 DSOFramer._FramerControl.Open(Object Document, Object ReadOnly, Object ProgId, Object WebUsername, Object WebPassword)System.Runtime.InteropServices.COMException (0x80010001): 被呼叫方拒绝接收呼叫。
查了很多资料,参考文章:
https://blog.youkuaiyun.com/jiongxian1/article/details/79552857