VBA & Macro Problems

Clear Excel ActiveX Combo Boxes When a Workbook Opens

Elise WilliamsElise Williams Nov 13, 2026 868 views

Question details

The user wants to clear multiple ActiveX combo boxes each time an Excel workbook opens, without deleting their list values.

Clear Excel ActiveX Combo Boxes When a Workbook Opens
Product
Microsoft Excel
Device & OS
not provided
Scenario
A workbook contains ActiveX combo boxes and needs to open with all combo boxes blank while preserving their drop-down list items.
Observed behavior
Combo boxes retain previous values when the workbook opens; the user wants a Workbook_Open event to reset them automatically.
Before you start

Open the workbook in Excel and press Alt+F11 to open the VBA editor. Make sure the workbook is not protected and that the VBA project is accessible before adding the Workbook_Open code.

Solution 1Recommended

Use Workbook_Open Event to Clear ActiveX Combo Boxes

Use this solution when you want all ActiveX combo boxes on a worksheet to reset to blank each time the workbook opens, without removing their drop-down list values.

This code loops through every OLEObject on the active sheet and clears only objects whose type is ComboBox. It does not remove the combo box list items, so the drop-down values remain available after the fields are cleared.

1
Open the VBA editor

In Excel, press Alt+F11 to open the Visual Basic for Applications editor.

2
Open the ThisWorkbook module

In the Project Explorer pane, find your workbook, expand Microsoft Excel Objects, and double-click ThisWorkbook.

3
Paste the Workbook_Open code

Copy the following code into the ThisWorkbook module: Private Sub Workbook_Open() Dim cb As OLEObject For Each cb In ActiveSheet.OLEObjects If TypeName(cb.Object) = "ComboBox" Then cb.Object.Value = "" End If Next cb End Sub

4
Save as a macro-enabled workbook

Go to File > Save As, choose Excel Macro-Enabled Workbook (*.xlsm), and save the file.

5
Reopen and enable macros

Close the workbook and reopen it. If prompted, click Enable Content or Enable Macros so the Workbook_Open event can run.

Use Workbook_Open Event to Clear ActiveX Combo Boxes
Target a specific worksheet: If the combo boxes are on a different sheet, replace ActiveSheet with Worksheets("Sheet1") using your actual sheet name.
Free Microsoft Office alternative

Use WPS Office as a Free, Lightweight Spreadsheet Alternative

This ActiveX VBA workflow belongs to Microsoft Excel and may not behave the same in WPS Office. If you are looking for a free, lightweight Office suite for everyday spreadsheet work, WPS Office opens Excel workbooks with a familiar ribbon, strong Microsoft Office format compatibility, and a simple migration path.

  1. 1. Download WPS Office: Go to the official WPS Office website and download the free Windows or Mac version.
  2. 2. Open your Excel workbook: Launch WPS Spreadsheets and open the existing .xlsx or .xlsm workbook.
  3. 3. Review the workbook: Check formulas, formatting, and data in the familiar ribbon interface, and save the file in a WPS-compatible Excel format.
Opens and saves .xlsx and .xlsm files with Microsoft Office format compatibilityFree to download and use with no Office 365 subscription requiredFamiliar ribbon interface reduces the learning curve after switchingLightweight and fast for daily spreadsheet tasksMaintains Excel workbook structure and formulas when opening files
microsoft office alternative - wps office

Frequently Asked Questions

Where should I put the code to clear ActiveX combo boxes when the workbook opens?

Open the VBA editor with Alt+F11, double-click ThisWorkbook under Microsoft Excel Objects, and paste the Workbook_Open event there. Code placed in a standard module will not run automatically on open unless it is called.

Will this VBA code delete the combo box list items?

No. It sets cb.Object.Value to an empty string, which clears the selected value but leaves the ListFillRange or list values intact.

How do I clear combo boxes only on a specific worksheet?

Replace ActiveSheet with Worksheets("Sheet1") in the code, changing Sheet1 to your actual sheet name. The loop will then affect only that worksheet.

Why does the macro not run when I open the file?

Save the workbook as an Excel Macro-Enabled Workbook (.xlsm), and click Enable Content or Enable Macros in the security warning when reopening.

Does this work in WPS Office the same way?

WPS Office can open Excel workbooks, but ActiveX controls and VBA may behave differently. For full ActiveX VBA behavior use Microsoft Excel, or test the workbook in WPS Office first.