Jump to content

Recommended Posts

Posted

Okay, I'm brand new to Visual Basic. When I close the spreadsheet I'm working on I get an Object Required error, which takes me to this:

Private Sub ComboBox2_Change()

If Not Closing Then

If Range("O1").Value = 1 Then

ComboBox6.Enabled = True

ComboBox1.Enabled = True

Else

ComboBox6.Enabled = False

ComboBox6.Value = 1

ComboBox1.Enabled = False

ComboBox1.Value = 2

End If

End If

End Sub

It points specifically to "ComboBox6.Enabled = False". That is the correct object name. What am I doing wrong?

Thanks!


Posted

I have never seen nor can I find that CLOSING is a valid object or event.

there are a couple of events related to worksheets closing. If you search for close or closing when in the VBA editor it will list them in the top 5 results.

Posted

The first thing I tried was taking out the CLOSING stuff. I had copied and pasted that out of the old spreadsheet I'm attempting to recreate. Even without that it generates the same error. It does it here as well:

Private Sub ComboBox3_Change()

If Range("L1").Value > 4 Then

ComboBox5.Enabled = False

ComboBox5.Value = 1

Else

ComboBox5.Enabled = True

End If

End Sub

For that it highlights "ComboBox5.Enabled = True".

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...