We help IT Professionals succeed at work.
Get Started

Excel VBA ActiveX Change Event Error

jobprojn asked
Last Modified: 2012-06-27
Hello.  Have a very interesting problem where when I invoke the _Change event on an ActiveX control.  The change event works fine up until the point where I refresh any external data range within my Excel spreadsheet.  

Below is my _Change event that is setup for an ActiveX combo box control called RunByComboBox.  

Private Sub RunByComboBox_Change()

                SupplierNameTextBox.Enabled = False

End Sub

This code works perfectly fine up until the point where I refresh an external data range with my spreadsheet.  Whenever I refresh a data range (any data range) I receive the following vba error message:

"Runtime error '1004'.  Unable to set the Enabled property of the OLEobject class".

When I attempt to debut it takes me to the "SupplierNameTextBox.Enabled = False" line in my vba code.

Does anyone know why I'm getting this error message on data refresh?  The data I'm refreshing is in no way related to the combo box or text box in question.  Also, for note this error message only occurs when I use the _Change or _Click events.  All other events are OK.  Unfortunately, I need the _Change event to work.

Any insight is greatly appreciated.
Watch Question
Top Expert 2008
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE