+ Reply to Thread
Results 1 to 14 of 14

Creating my own combobox class

Hybrid View

  1. #1
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Creating my own combobox class

    The objhandler objects can also be accessed by name or index, though here I did not specify a key when adding to the collection. There shouldn't really be any need to do this though - the sole purpose of the class is to handle events.
    The combobox is already on the sheet when you assign it to the objhandler class so that question doesn't really apply. Since Combo is a reference to the actual on-sheet combobox, all the properties are available.
    Unfortunately, activex controls are part of the vbproject so adding them or making design time changes, among other things, causes state loss and the collection goes out of scope and gets reset so you have to rerun the code. That's why I try to avoid controls on sheets generally and use Forms controls if possible if I really need controls on sheets.
    Everyone who confuses correlation and causation ends up dead.

  2. #2
    Registered User
    Join Date
    11-13-2010
    Location
    Springfield, IL
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Creating my own combobox class

    I've been trying to take the example that was posted above and re-work it into my own project. However, its just not working. I'm not sure at all why its not, the code is pretty much in there verbatim. RomperStomper, you said that the collection goes out of scope with design-time changes. What if the objects were stored in an array instead of a collection? Would the array also be subject to losing scope and being reset?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1