Excel VBA: how to cast a generic control object into a ComboBox object?

前端 未结 2 459
盖世英雄少女心
盖世英雄少女心 2020-12-10 04:11

I need to cast a generic VBA form control object into a ComboBox object so that I can add items to it. The generic object won\'t allow me to insert items into my existing li

相关标签:
2条回答
  • 2020-12-10 04:58

    You can "cast" an VBA Object by using SET, eg:

    SET lbCurrentComboBox = ctlCurrent
    
    0 讨论(0)
  • 2020-12-10 05:05

    If phil's answer didn't work try

    SET lbCurrentComboBox = ctlCurrent.Object
    
    0 讨论(0)
提交回复
热议问题