How to Use Activex Control in Excel (Easy Steps)

ActiveX controls offer more flexibility than Form controls. By using ActiveX controls such as command buttons, text boxes, and list boxes, you can streamline your work in Excel.

Let’s learn how to use ActiveX controls step by step:

Step 1 – Preparing the Dataset

Our goal is to use ActiveX controls with a dataset. Assume we have arranged data in column B. We’ll use a sample dataset overview in Excel for easy understanding.

Arranging Dataset to Use Activex Control in Excel

Read More: How to Use VBA Input Function in Excel


Step 2 – Inserting a Command Button from Excel ActiveX Controls

  • Go to the Developer tab.
  • Click Insert and select ActiveX Controls.

Inserting Command button to Use Activex Control in Excel

  • Choose the cell range where you want to insert the CommandButton1.

  • Insert the CommandButton1 option.

Step 3 – Applying VBA Macro Code

  • Right-click on the button and select View Code.

VBA window to Use Activex Control in Excel

  • In the VBA window, choose Module from the Insert tab.
  • Insert the following code:
Private Sub CommandButton1_Click()
    MsgBox "Hi Friend!, it's " & Time
End Sub

Inserting VBA code to Use Activex Control in Excel

  • Press Run. Clicking the button will give you the desired result.


How to Fix If Excel ActiveX Control Is Not Working

If the button isn’t working despite following the steps correctly, enable ActiveX controls:

  • Go to the File option.

Using File option to Use Activex Control in Excel

  • Click Info and select Trust Center Settings.

  • In the Trust Center dialog box, go to Trusted Documents, select Allow Documents on a network to be trusted and click OK.

  • If it still doesn’t work, go to ActiveX Settings, select Enable all controls with restrictions and click OK.


How to Remove ActiveX Control in Excel

  • Select the ActiveX control button.
  • Go to the Developer tab.
  • Turn off Design Mode.

Remove ActiveX control to Use Activex Control in Excel

  • Clicking the ActiveX control button won’t produce any result.

Things to Remember

  • Enable ActiveX control settings before using them.
  • Save files as Excel-Macro Enabled Workbook to use VBA code effectively.

Download Practice Workbook

You can download the practice workbook from here:


Related Articles

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Kawser Ahmed
Kawser Ahmed

Kawser Ahmed is a Microsoft Excel Expert, Udemy Course Instructor, Data Analyst, Finance professional, and Chief Editor of ExcelDemy. He is the founder and CEO of SOFTEKO (a software and content marketing company). He has a B.Sc in Electrical and Electronics Engineering. As a Udemy instructor, he offers 8 acclaimed Excel courses, one selected for Udemy Business. A devoted MS Excel enthusiast, Kawser has contributed over 200 articles and reviewed thousands more. His expertise extends to Data Analysis,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo