Excel 2013:Application.ActiveSheet生成异常。 HRESULT = 0x800A03EC [英] Excel 2013: Application.ActiveSheet generates exception. HRESULT = 0x800A03EC
问题描述
我有一个运行法语版Excel 2013的用户遇到基于我的VB.net(Visual Studio 2010)的共享COM加载项(不是VSTO)的问题。
I have a user running the French version of Excel 2013 who is experiencing problems with my VB.net (Visual Studio 2010) based shared COM add-in (not VSTO).
以下行生成异常:"Exception de HRESULT:0x800A03EC"
The following line generates an exception: "Exception de HRESULT : 0x800A03EC"
Dim xlActiveSheet As Excel.Worksheet = ExcelApplication.ActiveSheet
Dim xlActiveSheet As Excel.Worksheet = ExcelApplication.ActiveSheet
有一个活动工作表,ExcelApplication变量(灰色为Excel.Application)似乎是有效的,因为在OnConnection事件期间对此对象执行了许多方法。这段代码适用于
Excel 2013的英语(和日语)版本。
There is an active sheet, and the ExcelApplication variable (dimmed as Excel.Application) seems to be valid as numerous methods were executed on this object during the OnConnection event. This code works for me with the English (and Japanese) versions of Excel 2013.
我的插件知道外国语言环境(我学到了很难的方法,已将其本地化为日本和法国)但我怀疑在这种情况下我可能会遗漏一些东西。
My add-in is aware of foreign locales (I've learnt the hard way and have localized it for Japan and France) but I suspect there might be something I'm missing in this instance.
有人能说明为什么会失败吗?
Can anyone suggest why this is failing?
推荐答案
我有一个运行法语版Excel 2013的用户遇到了我的VB.net问题( Visual Studio 2010)基于共享COM加载项(不是VSTO)。
I have a user running the French version of Excel 2013 who is experiencing problems with my VB.net (Visual Studio 2010) based shared COM add-in (not VSTO).
以下行生成异常:"Exception de HRESULT:0x800A03EC"
The following line generates an exception: "Exception de HRESULT : 0x800A03EC"
Dim xlActiveSheet As Excel.Worksheet = ExcelApplication.ActiveSheet
Dim xlActiveSheet As Excel.Worksheet = ExcelApplication.ActiveSheet
有一个活动工作表,ExcelApplication变量(灰色为Excel.Application)似乎有效,因为执行了大量方法OnConnection事件期间的此对象。这段代码适用于
Excel 2013的英语(和日语)版本。
There is an active sheet, and the ExcelApplication variable (dimmed as Excel.Application) seems to be valid as numerous methods were executed on this object during the OnConnection event. This code works for me with the English (and Japanese) versions of Excel 2013.
我的插件知道外国语言环境(我学到了很难的方法,已将其本地化为日本和法国)但我怀疑在这种情况下我可能会遗漏一些东西。
My add-in is aware of foreign locales (I've learnt the hard way and have localized it for Japan and France) but I suspect there might be something I'm missing in this instance.
有人能说明为什么会失败吗?
Can anyone suggest why this is failing?
ExcelApplication.ActiveSheet不正确。层次结构是App>练习册>工作表所以正确的赋值语句是
ExcelApplication.ActiveSheet is not correct. The hierarchy is App > Workbook > Worksheet so the correct assignment statement is
Dim xlActiveSheet As Excel.Worksheet = ExcelApplication.ActiveWorkbook.ActiveSheet
这篇关于Excel 2013:Application.ActiveSheet生成异常。 HRESULT = 0x800A03EC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!