在Excel 2010中,“表单控件”和“ActiveX控件”之间的区别是什么?

时间:2021-08-16 15:17:48

Using Microsoft Excel 2010, I noticed two kind of controls that can be inserted into a document: Form Controls and ActiveX Controls.

使用Microsoft Excel 2010,我注意到可以插入到文档中的两种控件:表单控件和ActiveX控件。

在Excel 2010中,“表单控件”和“ActiveX控件”之间的区别是什么?

What is the difference between them?

它们之间有什么区别?

4 个解决方案

#1


69  

Google is full of information on this. As Hans Passant said, Form controls are built in to Excel whereas ActiveX controls are loaded separately.

谷歌有很多关于这个的信息。正如Hans Passant所说,表单控件内置在Excel中,而ActiveX控件则分别装入。

Generally you'll use Forms controls, they're simpler. ActiveX controls allow for more flexible design and should be used when the job just can't be done with a basic Forms control.

通常你会使用表单控件,它们更简单。ActiveX控件允许更灵活的设计,当工作无法用基本的表单控件完成时,应该使用ActiveX控件。

Many user's computers by default won't trust ActiveX, and it will be disabled; this sometimes needs to be manually added to the trust center. ActiveX is a microsoft-based technology and, as far as I'm aware, is not supported on the Mac. This is something you'll have to also consider, should you (or anyone you provide a workbook to) decide to use it on a Mac.

许多用户的电脑默认不会信任ActiveX,它将被禁用;这有时需要手工添加到信任中心。ActiveX是一项基于微软的技术,据我所知,它在Mac上不受支持。如果你(或任何你提供工作簿的人)决定在Mac上使用它,你也必须考虑这一点。

#2


18  

One major difference that is important to know is that ActiveX controls show up as objects that you can use in your code- try inserting an ActiveX control into a worksheet, bring up the VBA editor (ALT + F11) and you will be able to access the control programatically. You can't do this with form controls (macros must instead be explicitly assigned to each control), but form controls are a little easier to use. If you are just doing something simple, it doesn't matter which you use but for more advanced scripts ActiveX has better possibilities.

要知道的一个重要区别是ActiveX控件显示为可在代码中使用的对象——尝试将ActiveX控件插入工作表中,打开VBA编辑器(ALT + F11),您将能够编程地访问该控件。使用表单控件不能这样做(必须显式地为每个控件分配宏),但是使用表单控件要容易一些。如果你只是在做一些简单的事情,那么你使用什么并不重要,但是对于更高级的脚本,ActiveX有更好的可能性。

ActiveX is also more customizable.

ActiveX也更可定制。

#3


1  

Be careful, in some cases clicking on a Form Control or Active X Control will give two different results for the same macro - which should not be the case. I find Active X more reliable.

注意,在某些情况下,单击窗体控件或活动X控件将为相同的宏提供两个不同的结果——不应该是这样。我发现活跃的X更可靠。

#4


0  

It's also worth noting that ActiveX controls only work in Windows, whereas Form Controls will work on both Windows and MacOS versions of Excel.

值得注意的是,ActiveX控件只在Windows中工作,而表单控件在Windows和MacOS版本的Excel中都可以工作。

#1


69  

Google is full of information on this. As Hans Passant said, Form controls are built in to Excel whereas ActiveX controls are loaded separately.

谷歌有很多关于这个的信息。正如Hans Passant所说,表单控件内置在Excel中,而ActiveX控件则分别装入。

Generally you'll use Forms controls, they're simpler. ActiveX controls allow for more flexible design and should be used when the job just can't be done with a basic Forms control.

通常你会使用表单控件,它们更简单。ActiveX控件允许更灵活的设计,当工作无法用基本的表单控件完成时,应该使用ActiveX控件。

Many user's computers by default won't trust ActiveX, and it will be disabled; this sometimes needs to be manually added to the trust center. ActiveX is a microsoft-based technology and, as far as I'm aware, is not supported on the Mac. This is something you'll have to also consider, should you (or anyone you provide a workbook to) decide to use it on a Mac.

许多用户的电脑默认不会信任ActiveX,它将被禁用;这有时需要手工添加到信任中心。ActiveX是一项基于微软的技术,据我所知,它在Mac上不受支持。如果你(或任何你提供工作簿的人)决定在Mac上使用它,你也必须考虑这一点。

#2


18  

One major difference that is important to know is that ActiveX controls show up as objects that you can use in your code- try inserting an ActiveX control into a worksheet, bring up the VBA editor (ALT + F11) and you will be able to access the control programatically. You can't do this with form controls (macros must instead be explicitly assigned to each control), but form controls are a little easier to use. If you are just doing something simple, it doesn't matter which you use but for more advanced scripts ActiveX has better possibilities.

要知道的一个重要区别是ActiveX控件显示为可在代码中使用的对象——尝试将ActiveX控件插入工作表中,打开VBA编辑器(ALT + F11),您将能够编程地访问该控件。使用表单控件不能这样做(必须显式地为每个控件分配宏),但是使用表单控件要容易一些。如果你只是在做一些简单的事情,那么你使用什么并不重要,但是对于更高级的脚本,ActiveX有更好的可能性。

ActiveX is also more customizable.

ActiveX也更可定制。

#3


1  

Be careful, in some cases clicking on a Form Control or Active X Control will give two different results for the same macro - which should not be the case. I find Active X more reliable.

注意,在某些情况下,单击窗体控件或活动X控件将为相同的宏提供两个不同的结果——不应该是这样。我发现活跃的X更可靠。

#4


0  

It's also worth noting that ActiveX controls only work in Windows, whereas Form Controls will work on both Windows and MacOS versions of Excel.

值得注意的是,ActiveX控件只在Windows中工作,而表单控件在Windows和MacOS版本的Excel中都可以工作。