vba 为什么禁用开发人员选项卡的插入菜单上的 ActiveX 控件?

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

Why are ActiveX controls on the Insert menu of the developer tab disabled?

excelexcel-vbaactivexvba

提问by Joe

I need to programatically fill in the contents of a combobox that is on a worksheet in my Excel 2007 file from VBA. From some researching it seems this cannot be done with a "Forms Control", I must use an ActiveX version of the combobox.

我需要以编程方式填写 VBA 中 Excel 2007 文件中工作表上的组合框的内容。从一些研究来看,这似乎无法通过“表单控件”完成,我必须使用组合框的 ActiveX 版本。

That's all fine, except on the Insert menu of the Developer Tab in Excel, the only controls that are enabled that I can add are the form versions. All of the ActiveX controls are greyed out and I can't figure out why.

这一切都很好,除了在 Excel 中开发人员选项卡的插入菜单上,我可以添加的唯一启用的控件是表单版本。所有的 ActiveX 控件都是灰色的,我不知道为什么。

What am I missing? Macros are enabled. I've checked ActiveX security settings and set it to enable everything. Is there some add-in necessary that isn't installed by default?

我错过了什么?宏已启用。我已经检查了 ActiveX 安全设置并将其设置为启用所有内容。是否有一些默认情况下未安装的必要加载项?

回答by Patrick.B

I had the same problem. Unprotecting the workbook fixed it.

我有同样的问题。取消保护工作簿修复了它。

回答by Sparkfizt

Most likely you have not yet selected a cell in your worksheet.

您很可能尚未在工作表中选择单元格。

For some reason the ActiveX controls are greyed out if you don't have a cell selected (even though you draw the control onto the sheet...).

出于某种原因,如果您没有选择单元格,ActiveX 控件会显示为灰色(即使您将控件绘制到工作表上...)。

回答by Riga

Check the setting for View objects.

检查视图对象的设置。

Office Button > Excel Options > Advanced > Display Options for this workbook

Office 按钮 > Excel 选项 > 高级 > 此工作簿的显示选项

For objects, show: All

对于对象,显示:全部

Cheers Andy

干杯安迪

http://www.pcreview.co.uk/forums/insert-illustrations-disabled-grayed-out-excel-2007-a-t3813221p2.html

http://www.pcreview.co.uk/forums/insert-illustrations-disabled-grayed-out-excel-2007-a-t3813221p2.html

回答by Joe

I still have no idea why the ActiveX controls were disabled, but I abandoned my file and created a new one. The controls weren't disabled in my new file.

我仍然不知道为什么 ActiveX 控件被禁用,但我放弃了我的文件并创建了一个新文件。我的新文件中没有禁用控件。