vba Excel 2007 问题:预编程的按钮突然不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27434382/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:13:17  来源:igfitidea点击:

Excel 2007 Issue: Pre-programmed Buttons suddenly not working

excelvbabuttoncommand

提问by Will

Today, out of the blue, a form that the company I work for uses, suddenly had an issue with it's buttons. Strangely enough it only is affecting what I'm pretty sure are the ActiveX Command Buttons and not causing a problem with the other shapes or drop downs.

今天,我工作的公司使用的一种表单突然出现了按钮问题。奇怪的是,它只影响我很确定的是 ActiveX 命令按钮,而不会导致其他形状或下拉菜单出现问题。

The issue. The buttons are non-responsive. When you click, they don't access the code and checking them via the shapes menu and selecting "view code" causes them to open the developer menu, but not the code associated with them. The really big issue is that for some reason they ALL seem to have started failing at the same time. The version on the server no longer works (the primary copy), the copy the user uses (notorious for breaking things) and the version I use (which is on my local computer).

问题。按钮无响应。当您单击时,他们不会访问代码并通过形状菜单检查它们并选择“查看代码”会导致他们打开开发人员菜单,但不会打开与它们关联的代码。真正的大问题是,出于某种原因,它们似乎同时开始失败。服务器上的版本不再有效(主副本)、用户使用的副本(因破坏事物而臭名昭著)和我使用的版本(在我的本地计算机上)。

Is there a way to take them an re-associate them with the proper code, without deleting them completely re-making them or is there possibly someone who's had the same issue and figured out a fix?

有没有办法让它们与正确的代码重新关联,而不用完全删除它们重新制作它们,或者是否有人遇到过同样的问题并找到了解决办法?

I'd greatly appreciate any suggestions or help - please note: I'm 99.9% sure that the issue is not code based.

我非常感谢任何建议或帮助 - 请注意:我 99.9% 确定问题不是基于代码的。

回答by teylyn

The problem is caused by a recent Office update. Here is the fix posted on http://excelmatters.com/2014/12/10/office-update-breaks-activex-controls/

该问题是由最近的 Office 更新引起的。这是在http://excelmatters.com/2014/12/10/office-update-breaks-activex-controls/ 上发布的修复程序

To fix it, do this:

  1. Close all Office applications.
  2. Do a search in Windows Explorer – make sure to include hidden and system files and folders – for *.exd files (note: that's not *.exe !!) and delete any you find. Make sure you get these: C:\users\username\AppData\Local\Temp\Excel8.0\MSForms.exd C:\users\username\AppData\Local\Temp\VBE\MSForms.exd
  3. Reboot the computer (this is not always necessary, but probably better safe than sorry)
  4. Restart your Office apps and test the controls again.

要修复它,请执行以下操作:

  1. 关闭所有 Office 应用程序。
  2. 在 Windows 资源管理器中搜索 - 确保包括隐藏和系统文件和文件夹 - 以查找 *.exd 文件(注意:这不是 *.exe !!)并删除您找到的任何文件。确保你得到这些:C:\users\username\AppData\Local\Temp\Excel8.0\MSForms.exd C:\users\username\AppData\Local\Temp\VBE\MSForms.exd
  3. 重新启动计算机(这并不总是必要的,但可能比抱歉更安全)
  4. 重新启动 Office 应用程序并再次测试控件。