Combination button/dropdown in office -


how add combination button/dropdown in office (see below). preferably code.

alt text

update: if helps any, code isn't needed.

you can it, based on following activex controls:

  • microsoft imagelist control, version 6
  • microsoft imagecombobox control, version 6

manually, select "more controls..." [control toolbox] menu bar , double click mentioned controls them on sheet. position combobox want be, , disregard position of imagelist, visible in design mode. have 2 embedded contros named

  • imagelist1
  • imagecombo1

the insertion of 2 components creates reference ...\system32\mscomctl32.ocx.

then you

  1. manually add icons (gif, bmp, etc) image list
  2. manually set combo's imagelist property "imagelist1"
  3. manually set combo's autoload property true

by have combo error no icons.

then execute code

sub fillcombo() dim sh worksheet, oo oleobjects, idx integer      set sh = activesheet     set oo = sh.oleobjects       oo("imagecombo1").object         .comboitems.clear         idx = 1 oo("imagelist1").object.listimages.count             .comboitems.add , , , idx         next idx     end  end sub 

i've tried hard create objects vba, imagecombo seems behave different when created as

set sh = activesheet set oo = sh.oleobjects oo.add "mscomctllib.imagecomboctl.2" ' .... etc .... 

the combo created, dropdown arrow not displayed no matter do, allthough debugger shows listview elements neatly attached. lots of colleagues seem have problems activex, there's loads of posting on net.

further reading here


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -