Application.COMAddIns下标超出范围 [英] Application.COMAddIns Subscript out of range

查看:95
本文介绍了Application.COMAddIns下标超出范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是示例案例





上面,我到Excel的完整路径是:


C:\Program Files(x86 )\Microsoft Office\root\Office16\Excel.exe


然后,按F5键启动Excel ,您可以通过单击开发人员标签上的 COM加载项按钮来检查已加载的COM加载项。




Following the sample case below

https://msdn.microsoft.com/en-us/library/bb608614.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

Run into a 'Subscript out of range' in

Set addIn = Application.COMAddIns("ExcelImportData")

New to VSTO and C#. How do I debug this?

解决方案

If the add-in subscript is out of Range, it suggests that you've either made a typo in the name of the add-in while creating the VSTO project, or you've failed to open Excel using the debugger (which automatically loads the add-in).

You can ensure that Excel is loading properly by adjusting the Project Properties in Visual studio:

Above, my full path to Excel is:

C:\Program Files (x86)\Microsoft Office\root\Office16\Excel.exe

Then, once you've pressed F5 to start Excel, you can check the loaded COM add-ins by clicking on the COM add-ins button on the Developer tab.

这篇关于Application.COMAddIns下标超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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