托管Visio Control Excel 2013和2016 VSTO工作簿

时间:2018-03-02 14:31:48

标签: excel vsto visio

我希望在Excel 2013和2016 VSTO Workbook项目中托管visio控件,但我在设计器自动插入的一行中遇到运行时错误。

我可以找到有关如何创建VSTO工作簿项目的一般信息,但没有具体说明此问题。我也在Visio Technet论坛上提交了这个问题,并且微软的一个人简单地提到了这个问题,但这个问题已经没有了。

事实上,我确实让我的项目在我的任务窗格中使用Telerik Diagram,但我们更愿意使用Visio图表。

这最终是“内部错误”

的违规行
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).EndInit();

托管控件在常规Control库项目,表单项目等中运行良好。

重新制作很容易。

  1. 创建Excel文档VSTO
  2. 添加任务窗格+ visio control
  3. 添加代码以显示任务窗格并运行项目。
  4. 这是完整的堆栈跟踪

    *

    at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
       at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
       at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
       at System.Windows.Forms.AxHost.CreateInstance()
       at System.Windows.Forms.AxHost.GetOcxCreate()
       at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
       at System.Windows.Forms.AxHost.CreateHandle()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.AxHost.EndInit()
       at R2T.Workflow.InitializeComponent() in C:\Users\ramon.aldana\Source\R2T\R2T\Workflow.Designer.cs:line 196
       at R2T.Workflow..ctor() in C:\Users\ramon.aldana\Source\R2T\R2T\Workflow.cs:line 13
       at R2T.ThisWorkbook.ThisWorkbook_Startup(Object sender, EventArgs e) in C:\Users\ramon.aldana\Source\R2T\R2T\ThisWorkbook.cs:line 15
       at Microsoft.Office.Tools.Excel.WorkbookImpl.OnStartup()
       at Microsoft.Office.Tools.Excel.WorkbookImpl.WorkbookExtensionImpl.Microsoft.Office.Tools.EntryPoint.OnStartup()
       at Microsoft.Office.Tools.Excel.WorkbookBase.OnStartup()
       at R2T.ThisWorkbook.FinishInitialization() in C:\Users\ramon.aldana\Source\R2T\R2T\ThisWorkbook.Designer.cs:line 57
       at Microsoft.Office.Tools.Excel.WorkbookBase.Microsoft.Office.Tools.EntryPoint.FinishInitialization()
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases executionPhases)
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.ExecuteEntryPoints()
    

    *

    非常感谢任何帮助。

0 个答案:

没有答案