“对象库无效或包含引用...”在Excel VBA与DatePicker [英] "Object Library invalid or contains references..." in Excel VBA with DatePicker

查看:1025
本文介绍了“对象库无效或包含引用...”在Excel VBA与DatePicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用具有很多VBA代码的Excel工作簿一段时间,现在我将这个文件发送给一些同事进行测试,它在他们的计算机上不工作。
我们都在同一家公司工作,并具有Windows XP SP2与Office 2003。

I have been working on a Excel workbook with lots of VBA code for a while and now I have send this file to some colleagues for testing and it does NOT work in their computer. We all work in the same company and have Windows XP SP2 with Office 2003.

该工作簿有一个窗体打开时,点击一个形状,它包含一些控制。
当他们点击表单的形状以显示以下错误:

The workbook has a form that opens when clicking over a shape and it contains some controls. When they click over the shape for the form to show the following error appears:


对象库无效或包含
引用对象定义,
无法找到

"Object Library invalid or contains references to object defintions that could not be found"

在表单中有一个DatePicker,我认为那里问题在于如果我从表单中删除datePicker并再次发送给他们文件,他们就不会收到这个错误消息。

In the form there is a DatePicker and I think there lies the problem. If I delete the datePicker from the form and send them the file again they do not get this error message.

我已经尝试删除mscomct2.exd文件两个网站 Microsoft lessanvaezi 但是错误stil弹出。我检查并生成了新的.exd文件。

I already tried deleting the mscomct2.exd file as mentioned in this two sites "Microsoft" and "lessanvaezi" but the error stil pops. I checked and the new .exd file was generated.

其他信息:


  1. 我检查他们的系统,他们的文件mscomct2.ocx在正确的位置(c:\Winxp\System32)。

  2. 如果我打开一个空的Excel文件,去到VBA编辑器进入工具 - >参考,我看不到注册Microsoft Common Control-2 6.0(SP6)(mscomct2.ocx)的选项。相反,我会看到一个Microsoft Windows Common Controls Satellite-3 6.2(cmct3de.dll)。

  3. 我发送我的collegue该文件与datePicker,但没有引用微软Common Control-2 6.0(SP6)。点击形状并打开窗体之前,我试图用下列代码二次引用MSCOMCT2.ocx库。它引用了Microsoft Common Control-2 6.0(SP6),但错误仍然弹出。




Sub RegisterCtl()

Sub RegisterCtl()

'MSComCt2.ocx
strGUID = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}"
ThisWorkbook.VBProject.References.AddFromGuid guid:=strGUID, Major:=1, Minor:=0

end Sub




  1. 如果我然后转到VBE编辑器中的表单,右键单击在
    工具箱上,然后转到
    附加控件添加
    Microsoft Date and TimePicker
    控制,我看到该选项列出
    两次。不幸的是,没有一个我bc b的b $ b,行为
    是一样的:datepicker符号
    被添加到工具箱中,但是当我
    拖动控件到窗体时,
    msgBox弹出说控件
    不可用。

有人有什么想法有什么问题吗?我可以做些什么来让它在电脑中运行?

Has anybody an idea what is wrong? What can I do to make it run in their computer?

感谢任何帮助。

编辑:

这个问题的电脑已升级,所以我无法找到我的案例的具体解决方案。我选择了Archers解决方案,因为它帮助了大多数人(Most Upvotes)。

The computer with this problem has been Upgraded so I wont be able to find the specific solution for my case. I'm choosing Archers solution as it has helped the most people (Most Upvotes).

推荐答案

我也有同样的问题。 http://support.microsoft.com/kb/957924/en-us 删除所有.exd文件使我的程序工作!

I have the same problem too. http://support.microsoft.com/kb/957924/en-us delete all .exd files make my program work!

进入命令提示符并键入以下DOS命令:

Go into a command prompt and type the following DOS commands:

代码:


CD \文档和设置

CD \Documents and Settings

DEL / S / A:H / A:-H * .EXD

DEL /S /A:H /A:-H *.EXD

这篇关于“对象库无效或包含引用...”在Excel VBA与DatePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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