Excel VBA“自动化错误”由于2016年1月Office Update,可能由MSCOMCTL.OCX(Microsoft Windows Common Controls 6.o(Service Pack 6))引起) [英] Excel VBA "Automation Error" due to Jan 2016 Office Update, probably caused by MSCOMCTL.OCX (Microsoft Windows Common Controls 6.o (Service Pack 6))

查看:2978
本文介绍了Excel VBA“自动化错误”由于2016年1月Office Update,可能由MSCOMCTL.OCX(Microsoft Windows Common Controls 6.o(Service Pack 6))引起)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经找到了解决方案:

我已经使用Microsoft Windows Common Controls 6.0(Service Pack 6)添加了一个Treeview Active X控件到我们的一个电子表格,即MSCOMCTL.OCX,它居住在c :\Windows\SysWOW64\



KB2881029(Microsoft Office 2010 32位版本的安全更新)(MS16-004),从Microsoft推出15 / 01/2016(或其附近)安装新的MSCOMCTL.OCX(版本6.1.98.46,Created9/12/2015,但在更新时访问(即安装在计算机上)。
这使得工作簿松散引用到MSCOMCTL.OCX(引号为松散,因为引用仍然被勾选但不再工作,该工作簿由于编译错误:对象库功能不支持或自动化错误)
似乎更新通过添加SubKey 2.0修改注册表项HKEY_CLASSES_ROOT\TypeLib {831FDD16-0C5C-11D2-A9FC-000F8754DA1} \
,但是将其留空,并且不会注册新的MSCOMCTL.OCX。



解决问题需要三个步骤:



1)MSCOMCTL.OCX。需要取消注册并重新注册

(开始按钮/搜索/命令/右键单击命令提示符/作为admistirator运行:
c:\Windows\system32> Regsvr32 / u C :\Windows\SysWOW64\MSCOMCTL.OCX
c:\Windows\system32> Regsvr32 C:\Windows\SysWOW64\MSCOMCTL.OCX



通过REGSVR32注册新的MSCOMCTL.OCX(版本6.1.98.46)时,注册表中会添加一个新密钥:
HKEY_CLASSES_ROOT\TypeLib {831FDD16-0C5C-11D2-A9FC-000F8754DA1} \2.2
如果有一个名为2.1的SubKey已经存在,它会输入一个引用,2.2现在是使用的键
但是对空的2.0 SubKey!没有任何作用!



如果有一个2.0(或2.1),SubKey中没有任何东西,使用该OCX的任何对象都无法创建,因为它将使用2.0(相应的2.1)版本,它可以't并没有检查2.2版本。



2)通过删除错误或supe来清理注册表已锁定的键2.0& 2.1并且只留下最新的工作密钥2.2

(开始按钮/搜索/命令/右键单击命令提示符/作为admistirator运行:
c:\Windows\system32> Regedit
选择HKEY_CLASSES_ROOT,编辑/查找/ MSCOMCTRL.OCX)



(注意:此步骤似乎是可选的,因为我已经检查过,只做第1步和第3步使工作簿工作3)在Excel工作簿VBA项目中,Microsoft Windows Common Controls 6.0(Service Pack 6)需要被引用并重新引用。重新引用它不仅仅是重新勾选框,您需要使用浏览,并在c:\Windows\SysWOW64\
中选择MSCOMCTL.OCX(注意,在浏览器窗口,您需要将文件类型从dll更改为OCX(或全部)。



Daniel Alexander Karr亲自分享一个他自己写的脚本,自动执行步骤1和2(注意,需要运行AS ADDMINISTRATOR)。
感谢Daniel和wmelonman的帮助,了解问题并找到一个解决方案。



原始POST:

与所描述的类似在这个3岁的帖子
,我的一个完美工作的工作簿从一天到下一个工作...



在昨天晚上进行的更新列表中,以下是Office更新:




  • KB3114563(定义更新Microsoft Office 2010 32位版本)

  • KB2881029(Microsoft Office 2010 32位版本的安全更新程序)

  • KB3114555(Microsoft Office 2010更新32位版本)

  • KB3114553(Microsoft Office 2010 32位版本的安全更新程序)

  • KB3114564(Microsoft Excel安全更新程序2010 32位版本)

    还有其他更新,但一般的Microsoft Windows更新,不是Office特有的,他们希望在这里不相关。



我的理解是,自动化错误是由于项目没有编译,因为在我从Microsoft Windows Common引用的一种表单上存在2个附加ActiveX控件控件6.0(Service Pack 6),即MSCOMCTL.OCX,其位于c:\Windows\SysWOW64\



遗憾的是,取消注册并重新注册此MSCOMCTL .OCX如上述帖子中所述没有解决问题。



我也尝试删除所有* .exd,但是我的C:驱动器上没有



可能相关的其他信息:




  • MSCOMCTL.OCX文件版本是6.1.98.46,创建&最后修改日期为9/12/2015,但于昨天(15/01/2016)上午3时33分访问,即大约在更新发生的同一时间(最近一个上午3:14)。

  • 通过初始的自动化错误消息后,我将收到一个编译错误:不支持对象库功能,突出显示与其他控件相关联的代码行。

  • 我已经验证了这些是通过创建一个尝试添加一个的空白表单来导致问题。我收到错误消息由于错误800a0011无法完成操作。

  • 这些附加控件是Microsoft TreeView Control 6.0(SP6)和Microsoft ImageList Control 6(SP6)。

  • 我可以添加Microsoft TreeView控件版本5.0(SP2)和Microsoft ImageList控件版本5.0(SP2),而不会引起错误(我没有尝试使它们工作)。



有没有人知道与MSCOMCTL.OCX在昨天的Microsoft更新之后的类似的不幸?这可能会证实这可能是我的问题的根源。



有人知道修复吗?



任何人都知道如何向Microsoft报告(如果确实是问题的根源)?



最后,对于那些感兴趣的人,有一种方法可以避免Microsoft更新搞砸ActiveX控件...不使用它们!这是JPK为他的 TreeView 所做的。 p>

解决方案

感谢所有的贡献,

我发现取消引用并重新引用Microsoft Windows Excel VBA项目中的Common Controls 6.0(Service Pack 6)将最终使其正常工作。

!!! ...但是...

简单的取消勾选/打勾勾选框会太简单了!要重新引用它,您需要使用浏览,并在c:\Windows\SysWOW64\

中选择MSCOMCTL.OCX(请注意,在浏览器窗口中,需要更改文件类型从dll到OCX(或全部))

我已经尝试在一个没有运行丹尼尔·亚历山大的补丁的机器上这样做(要注销和重新注册,注册MSCOMCTL.OCX,并从寄存器中删除旧的空的2.0密钥),并且它不起作用,所以我期望上述步骤是必需的。我将尝试彻底测试哪些步骤是必要的,并编辑此答案以逐步阐明整个过程,但暂时运行Daniel Alexander的修补程序(AS ADMINISTRATOR!)并重新引用Microsoft Windows Common Controls 6.0(服务) Excel VBA项目中的Pack 6)似乎工作。


EDITED ONCE SOLUTION WAS FOUND:
I have added a Treeview Active X Control to one of our spreadsheet, using Microsoft Windows Common Controls 6.0 (Service Pack 6), i.e. MSCOMCTL.OCX which lives in c:\Windows\SysWOW64\

KB2881029 (Security Update for Microsoft Office 2010 32-Bit Edition) (MS16-004), pushed out from Microsoft on the 15/01/2016 (or thereabout), installs a new MSCOMCTL.OCX (version 6.1.98.46 which was "Created" 9/12/2015, but "Accessed" (i.e. installed on the computer) at the time of the update). This made the workbook "loose" reference to MSCOMCTL.OCX (quote marks on "loose", because the reference is still ticked but no longer works, the workbook doesn't compile because of "Compile error: Object library feature not supported" or "Automation error") It seems that the update modifies the registry key HKEY_CLASSES_ROOT\TypeLib{831FDD16-0C5C-11D2-A9FC-000F8754DA1}\ by adding a SubKey 2.0, but leaves it empty, and doesn't register the new MSCOMCTL.OCX.

Fixing the problem requires 3 steps:

1) MSCOMCTL.OCX. needs to be un-registered and re-registered
(Start button/search/command/right click command prompt/run as admistirator: c:\Windows\system32>Regsvr32 /u C:\Windows\SysWOW64\MSCOMCTL.OCX c:\Windows\system32>Regsvr32 C:\Windows\SysWOW64\MSCOMCTL.OCX

When registering the new MSCOMCTL.OCX (Version 6.1.98.46) via REGSVR32, a new key is added in the Registry: HKEY_CLASSES_ROOT\TypeLib{831FDD16-0C5C-11D2-A9FC-000F8754DA1}\2.2 If there was a SubKey named 2.1 already existing, it enters a reference that 2.2 is now the Key for use. But it doesn't do anything to the empty 2.0 SubKey !

If there is a 2.0 (or 2.1 for that matter) SubKey with nothing in it, any object using that OCX should fail to create because it will use the 2.0 (resp 2.1) Version, it can't and didn't check for 2.2 Version.

2) Clean up the registry by deleting the wrong or superseded keys 2.0 & 2.1 and leaving only the latest and working key 2.2
(Start button/search/command/right click command prompt/run as admistirator: c:\Windows\system32>Regedit Select HKEY_CLASSES_ROOT, Edit/Find/MSCOMCTRL.OCX)

(Note: this step seems optional as I have checked that doing only step 1 & 3 made the workbook work again. But it feels like the right thing to do)

3) In the in the Excel workbook VBA project, Microsoft Windows Common Controls 6.0 (Service Pack 6) needs to be de-referenced and re-referenced. Re-referencing it, is not just a matter of re-ticking the box, you need to use "browse", and select MSCOMCTL.OCX in c:\Windows\SysWOW64\ (note, in the browser window, you need to change the file type from "dll" to "OCX" (or "all"))

Daniel Alexander Karr (refer post further below) has kindly shared a script he wrote to do steps 1&2 automatically (Attention, needs to be run AS ADDMINISTRATOR). Thanks Daniel and wmelonman for your help in understanding the problem and finding a solution.

ORIGINAL POST:
Similarly to what is described in this 3 year old post (VBA Automation Errors due to Office Service Pack 3.0 caused by Forms), a perfectly working workbook of mine stopped working from a day to the next...

In the list of updates carried out last night the following ones are Office Updates:

  • KB3114563 (Definition Update for Microsoft Office 2010 32-Bit Edition)
  • KB2881029 (Security Update for Microsoft Office 2010 32-Bit Edition)
  • KB3114555 (Update for Microsoft Office 2010 32-Bit Edition)
  • KB3114553 (Security Update for Microsoft Office 2010 32-Bit Edition)
  • KB3114564 (Security Update for Microsoft Excel 2010 32-Bit Edition)
    There were other updates, but general Microsoft Windows updates, not specific to Office, and they hopefully are not relevant here.

My understanding is that the "Automation error" is due to the project not compiling because of the presence of 2 "additional" ActiveX controls on one of my forms that I have referenced from Microsoft Windows Common Controls 6.0 (Service Pack 6), i.e. MSCOMCTL.OCX which lives in c:\Windows\SysWOW64\

Unfortunately un-registering and re-registering this MSCOMCTL.OCX as explained in the aforementioned post didn't solve the problem.

I also tried deleting all *.exd, but there weren't any on my C: drive.

Additional info that may be relevant:

  • MSCOMCTL.OCX file version is 6.1.98.46, created & last modified 9/12/2015 but accessed at 3.33am yesterday (15/01/2016), i.e. about the same time the updates occurred (3:14am for the latest one).
  • Once passed the initial "automation error" message I would get a Compile error: Object library feature not supported, highlighting lines of codes associated with the additional controls.
  • I've verified these were "causing" the problem by creating a blank form an trying to add one on. I got the error message "Could not complete the operation due to error 800a0011".
  • These additional controls are Microsoft TreeView Control 6.0 (SP6) and Microsoft ImageList Control 6 (SP6).
  • I could add the Microsoft TreeView Control, Version 5.0 (SP2) and Microsoft ImageList Control, Version 5.0 (SP2) without raising the error (I didn't try making them work though).

Does anyone know of similar mishap with MSCOMCTL.OCX following yesterday's Microsoft updates? That may confirm it could be the source of my problem.

Does anyone know of a fix?

Does anyone know how to report this to Microsoft (if indeed it is the source of the problem)?

And finally, for those interested, there is a way to avoid Microsoft Updates messing up ActiveX controls...not using them! This is what JPK has done for his TreeView.

解决方案

Thanks all for your contributions,
I have found that de-referencing and re-referencing the Microsoft Windows Common Controls 6.0 (Service Pack 6) in the Excel VBA project would finally make it work.
!!!...BUT...!!!
Simply un-ticking / re-ticking the tick box would be too simple ! For re-referencing it, you need to use "browse", and select MSCOMCTL.OCX in c:\Windows\SysWOW64\
(note, in the browser window, you need to change the file type from "dll" to "OCX" (or "all"))
I have tried simply doing this on a machine where I hadn't run Daniel Alexander's Patch (to un-register and re-register MSCOMCTL.OCX, and remove the old empty 2.0 key from the register), and it didn't work, so I expect the above steps are required. I will try to thoroughly test which steps are necessary and edit this answer to spell out the whole procedure, step by step, but for the time being running Daniel Alexander's patch (AS ADMINISTRATOR !) and re-referencing Microsoft Windows Common Controls 6.0 (Service Pack 6) in the Excel VBA project seem to work.

这篇关于Excel VBA“自动化错误”由于2016年1月Office Update,可能由MSCOMCTL.OCX(Microsoft Windows Common Controls 6.o(Service Pack 6))引起)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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