Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    May 2002
    Location
    Loveland, Ohio, USA
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box Contents (2003)

    I asked a question yesterday about a survey that I was creating in PowerPoint using VBA. I think I have gotten over most all of my hurdles, but one question/technique remains a mystery. When creating ComboBoxes, I can not find any way to create the list of contents. I do not want to draw the choices from anywhere else, I just want them to be static list entries.

    So say I wanted a combo box with Choice 1 through Choice 3 in it. The only way I found to edit the CB contents was to use a tool called the PowerPoint VBA Controls Assistant. This tool sits at the bottom of the Edit menu and allows you to add the CB and edit its contents on the fly, or you can select the CB and then edit the contents at any time after creation.

    I have searched and searched and can not find out how to create the content list without this tool. Also, can someone recommend a comprehensive VBA book, and a good source of code snippets. I searched the lounge and came up dry too.

    Thanks!

    Andy

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Combo Box Contents (2003)

    I populate UserForm controls in the _Initialize event handler.

    Open the code module for your userform and choose UserForm in the left drop box and Initialize in the right box.

    Then create code such as:

    with Me.ComboBox1
    .AddItem "Choice 1"
    .AddItem "Choice 2"
    .AddItem "Choice 3"
    End with

  3. #3
    Star Lounger
    Join Date
    May 2002
    Location
    Loveland, Ohio, USA
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Contents (2003)

    Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>

    One additional problem. I used the VBA Controls Assistant (http://officeone.mvps.org/ppvba/ppvba_using.html) to populat eht combBox's, but when I ship the presentation to someone else, the comboBox's are no longer populated.

    Can someone tell me what I have missed in trying to ship this off to someone else from my machine? I can not enclose my presentation it is apparently too big. There is code for a "Submit" button click, but nothing else. I have no idea where the ComboBox values are being stored..

    Thanks,

    Andy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box Contents (2003)

    I think you are using controls on a slide, so Jefferson's reply would not apply to your situation.
    The problem you mention is one of the reasons why PowerPoint is less than ideal for this. In Excel, it would be much easier - you can populate a combo box from a range of cells.

  5. #5
    Star Lounger
    Join Date
    May 2002
    Location
    Loveland, Ohio, USA
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Contents (2003)

    Thanks Hans, I will go down the Excel path.

Posting Permissions

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