Link to home
Start Free TrialLog in
Avatar of Kirkeous
Kirkeous

asked on

MS Excel 2003: How do I make Combo Box Invisible?

Dear Guru -

How do I make a ComboBox invisible? I just want that shape to be invisible. It is called ComboBox1 on Sheet18.

I keep getting Run Time Error 1004. OLEClass not defined.

Many Thanks,
Kirk
Avatar of Tracy
Tracy
Flag of United States of America image

If what you're talking about having the shape invisible, right click on the combo box and click properties.  Then for BorderStyle set it to 1 - frmBorderStyleSingle.  Then for BorderColor, click the drop down and select Window Background.
Avatar of Kirkeous
Kirkeous

ASKER

Thanks, but you can still see the "down arrow". Is there a way just to make it invisible?
I tried this:

 ActiveSheet.Shapes("ComboBox1").Visible = False

And I get a run-time error (a lot of numbers!) and it says"

"The item with the specified name wasn't found
ASKER CERTIFIED SOLUTION
Avatar of Kirkeous
Kirkeous

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do this:
In VBE double click the sheet that has the combobox on it.
Paste this in it:
Public Sub hideCB()
ComboBox1.Visible = False
End Sub
Now in your other modules use this:
Call Sheet1.hideCB

'or whatever the sheet module is called, I used sheet1 (could be sheet2, sheet3, mysheet, etc)
or you could just use this:
Dim cb As OLEObject
Set cb = ActiveSheet.OLEObjects("ComboBox1")
cb.Visible = False
Or less code:
Activesheet.OLEObjects("ComboBox1").Visible = False
I would like the author to explain how the responses to this inquiry didn't help them as my response, and maybe the others before, provided a proven solution.
Because I figured it out on my own! But thanks always to the great minds here!
Would you please share your solution and how it differed from the one's posted above?
MWGainesJR -

First, thank you very much for posting a solution; however, if you look at the time I had already closed this out before you posted a solution!

Thanks very much.

Kirkeous