Excel / VBA自动化由于Office Service Pack 3.0导致的错误 [英] Excel/VBA Automation Errors due to Office Service Pack 3.0 caused by Forms

查看:116
本文介绍了Excel / VBA自动化由于Office Service Pack 3.0导致的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装所有最新的Windows更新后,我的Excel VBA代码在第一个模块的开始显示自动化错误。它包含一些形式以及VBA代码的许多模块。但是,删除表单(和相关的代码)一切都很好。

After installing all latest windows updates my Excel VBA code is showing an automation error at the very start of the first module. It contains some forms as well as numerous modules of VBA code. However, when removing the forms (and associated code) everything is fine.

同样的事情发生在一年前,在其他一些Windows更新之后。然后删除.exd文件做了一个诀窍,但目前的更新(包括Service Pack 3)似乎是不同的。

The same thing happened about a year ago after some other windows updates. Back then deleting the .exd files did the trick, but the current updates (including Service Pack 3) seem to be different.

发生了什么,我该怎么做工作形式?所有代码不变,并且在所有以前的Windows / Office更新中都能够幸存下来。运行Windows 7(同样发生在Vista机器上)和Office 2007。

What is going on and how can I get the forms to work? All the code is unchanged and has survived all previous windows/office updates. Running Windows 7 (same happening on Vista machine) and Office 2007.

推荐答案

我曾经看过这么多的 Visual Basic和Crystal Reports ;由于部署不正确或 DLL Hell

I used to see this a lot with Visual Basic and Crystal Reports; either due to a bad deployment or DLL Hell.

所以,我的猜测是,它不是代码,但也可能是您使用的一些第三方控件(OCX,DLL)。

So, my guess is that it's not the code but perhaps some 3rd party controls (OCXs, DLLs) you're using.

检查您的引用(在VBA IDE中,单击工具和参考),并查看每个DLL指向的位置。

Check your References (In VBA IDE, click Tools and References) and to see where each DLL is pointing.

查看图书馆中的任何日期是否与工作机器不同,您可能会发现罪魁祸首。

See if any of the dates on the libraries are different than a working machine and you may find the culprit.

修改

OP按照上述步骤找到问题。

The OP found the problem by following the steps above.

此特定问题的解决方案是取消注册mscomctl.ocx:

The fix for this particular issue is to unregister mscomctl.ocx:

regsvr32 /u mscomctl.ocx 

然后注册:

regsvr32 mscomctl.ocx

这篇关于Excel / VBA自动化由于Office Service Pack 3.0导致的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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