locked
What are Microsoft.Office.Tools.Excel.Controls? RRS feed

  • Question

  • Hello there!

    This is my first post here on Social MSDN. I'm not sure if I can ask Excel VBA Development questions here.

    Anyways, here are my questions:

    1. What are  Microsoft Office Tools Excel Controls ? How to use them in Excel VBA ?

    2. How can I see these controls (such as command button control on Userform toolbox in Excel VBA) for my excel userforms?

    3. Can I use Microsoft Windows listbox in vba excel, as excel vba's listbox lacks many things. If yes, how ?

    I do hope the admin doesn't mind me posting multiple questions.

    I am still learning Excel VBA and developing my own accounting application using it, so I do hope I'll learn a lot from this website.

    Thank you

    Profound Regards.


    Sunday, May 17, 2015 6:37 PM

Answers

  • Hi,

    >>What are  Microsoft Office Tools Excel Controls ? How to use them in Excel VBA ?<<

    Did you mean the controls under the Microsoft.Office.Tools.Excel Namespace? If I understood correctly, the Microsoft.Office.Tools.Excel namespace contains a set of types that extend and support the Microsoft Office Excel object model in projects created by using the Office development tools in Visual Studio.

    You can get more detail from links below:
    Microsoft.Office.Tools.Excel Namespace

    Host Items and Host Controls Overview

    These controls are not available in Excel VBA, there are only available to used in VSTO solution.

    >>2. How can I see these controls (such as command button control on Userform toolbox in Excel VBA) for my excel userforms?<<

    We are not able to see these controls for Excel user form.

    >>3. Can I use Microsoft Windows listbox in vba excel, as excel vba's listbox lacks many things. If yes, how ?<<

    What did you mean Windows listbox? As far as I know, we can use form controls and ActiveX control in the Office application, and here is an helpful link for your reference:
    Overview of forms, form controls, and ActiveX controls on a worksheet

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 19, 2015 7:26 AM

All replies

  • The right forum for such question is Excel for Developers

    This link in not to answer your question, but to refer a rich reference to cover excel development:

    https://msdn.microsoft.com/en-us/library/office/fp179694.aspx

    https://support.office.com/en-sg/article/Add-a-list-box-or-combo-box-to-a-worksheet-555bee5f-96e6-4047-a469-78e4f1d988b3


    Fouad Roumieh

    Sunday, May 17, 2015 7:12 PM
  • Hi,

    >>What are  Microsoft Office Tools Excel Controls ? How to use them in Excel VBA ?<<

    Did you mean the controls under the Microsoft.Office.Tools.Excel Namespace? If I understood correctly, the Microsoft.Office.Tools.Excel namespace contains a set of types that extend and support the Microsoft Office Excel object model in projects created by using the Office development tools in Visual Studio.

    You can get more detail from links below:
    Microsoft.Office.Tools.Excel Namespace

    Host Items and Host Controls Overview

    These controls are not available in Excel VBA, there are only available to used in VSTO solution.

    >>2. How can I see these controls (such as command button control on Userform toolbox in Excel VBA) for my excel userforms?<<

    We are not able to see these controls for Excel user form.

    >>3. Can I use Microsoft Windows listbox in vba excel, as excel vba's listbox lacks many things. If yes, how ?<<

    What did you mean Windows listbox? As far as I know, we can use form controls and ActiveX control in the Office application, and here is an helpful link for your reference:
    Overview of forms, form controls, and ActiveX controls on a worksheet

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, May 19, 2015 7:26 AM
  • First you need to show the Developer tab which is not visible by default.

    2007: Options, Popular, Top options for working with Excel, tick "show developer tab"
    2010: Options, Customize, Main tabs, tick Developer

    In the Controls group on the Developer tab click Insert and you can choose from two types of controls to add to worksheets.

    Form controls: essentially these are more like Shapes though with some you can "link" to cells. The OnAction property can be assigned a macro in a normal module to be called when the control is clicked. Right click on the control and go from there.

    ActiveX controls: These may be similar in appearance but expose a series of events that can be trapped in code behind the worksheet. After inserting a control double click it and normally it will take you to the Click event in the worksheet module. Look for other events in the dropdowns in the code module. When done exit "Design mode" with button on next to Insert on the Developer tab.

    Tuesday, May 19, 2015 8:57 AM