vba Excel 2007 宏按钮变灰

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8006337/
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 12:08:55  来源:igfitidea点击:

Excel 2007 macro buttons greyed out

excelexcel-vbavba

提问by Jason Chekofsky

My macro options are greyed out in Excel 2007. i've adjusted the settings in the trust center and attempted to install the VBA add-in.

我的宏选项在 Excel 2007 中显示为灰色。我已经调整了信任中心的设置并尝试安装 VBA 加载项。

I cant record or enable any macros. How do I fix this?

我无法录制或启用任何宏。我该如何解决?

Thanks.

谢谢。

回答by Jason Chekofsky

figured it out - it had to do with the initial install. the option to install "with VBA components" was never selected. had to uninstall, then re-install.

想通了 - 它与初始安装有关。从未选择安装“使用 VBA 组件”的选项。不得不卸载,然后重新安装。

now it works beautifully. thanks for the help!

现在它工作得很好。谢谢您的帮助!

回答by Robert Ilbrink

Jason,

杰森,

The first thing to check is if you can run any macro's at all. What happens when you have the sheet with the macro buttons open and you then open the macro selector ([Alt]+[F8])?

首先要检查的是您是否可以运行任何宏。当您打开带有宏按钮的工作表,然后打开宏选择器 ([Alt]+[F8]) 时会发生什么?

If you can see and run the macro's from there, then you know that running the macro's is not blocked. In that case you could try to add a new set of buttons and throw the old (non-functioning) buttons away. Adding a button is easy. Make sure you have the "developer" tab available (enable in options) and select "controls", "insert". When you click on the button icon, a list of available macros should pop-up.

如果您可以从那里看到并运行宏,那么您就知道运行宏没有被阻止。在这种情况下,您可以尝试添加一组新按钮并将旧的(不起作用的)按钮扔掉。添加按钮很容易。确保您有可用的“开发人员”选项卡(在选项中启用)并选择“控件”、“插入”。当您单击按钮图标时,应弹出可用宏列表。

What I think has happened though is that the macro's where stored in PERSONAL.XLSB and that the sheet (with the buttons) does not contain the macro's. I.e. the sheet is an xlsx file and not an xlsm file. If the macro's where stored on an other sheet, you will have to copy the macro's to the sheet with the buttons. Use [Alt]+[F11] to open the macro editor and copy the macro's to the new sheet. In the macro editor, you will probably have to create a folder "Modules" by selecting "insert", "Modules".

我认为发生的事情是宏存储在 PERSONAL.XLSB 中,并且工作表(带有按钮)不包含宏。即工作表是一个 xlsx 文件,而不是一个 xlsm 文件。如果宏存储在其他工作表上,则必须使用按钮将宏复制到工作表中。使用 [Alt]+[F11] 打开宏编辑器并将宏复制到新工作表。在宏编辑器中,您可能需要通过选择“插入”、“模块”来创建文件夹“模块”。

If you need more help, just ask.

如果您需要更多帮助,请直接询问。

Regards,

问候,

Robert Ilbrink

罗伯特·伊尔布林克