Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Value of an ActiveX Combobox

Status
Not open for further replies.

drrocket5292

Technical User
Sep 6, 2005
73
0
0
US
I'm trying to set the value of an active combobox embedded on an excel worksheet. Its a 2 column combobox and the first columns a bound column. Is it possible to set the value of a bound control in excel? Anytime I use the .value property I get an error saying that it could not set the value property of the control. Its not that big of a deal, its just that each time I open the workbook I'd like for the combobox to be on the item I last selected. Any ideas on what I'm doing wrong? Thanks for the help.
 


Hi,

Please post the code you have for initializing your combo.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
SkipVought,
As soon as i submitted that post I figured out how to fix it. Isnt that how it always seems to work? I have another annoyance though that maybe you would know how to fix off the top of your head. I created a class module that treats the activeworkbook as if its my addins workbook. This allows me to throw a combobox up on to the worksheet everytime I open a version of a certain workbook. (The guy before me used a certain workbook as a template and then would SaveAs and put a name and date on it so theres hundreds of these workbooks) However, when I click on that combobox to select an item, it then puts a Combobox_click event procedure in the thisworkbook module of the workbook I'm using. This is annoying because I've got my macro security settings set to medium so every time I open one of these worksheets it asks me if I want to enable macros. Not that big of a deal but annoying since one of the reasons I'm using addins is so that there aren't macros in each of the hundreds of copies of this workbook. Any ideas how to turn that off so that it doesnt put the event_procedure in there? Thanks for the help.
 


I don't know.

You might post this in a new thread to get some fresh bites.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
You would have to post the class module code. Can you look in there are see what events are there, then trace back what event is firing for the combobox and look there?

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top