Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2

    Red face Unanswered: Rowsource for userform in Excel add-in not working

    Hi all

    I've put together an add-in to circulate some company-specific date functions and some related functions. The add-in includes a couple of userforms (a help form and a calculator form), both of which have a combo box to display the list of available functions. The list is populated from a named range within the add-in - the sheets is called "DatesHelp" and the range "DHFunctions".

    While I was developing the forms with the file saved as a standard workbook, the following syntax in the RowSource for the combo boxes worked fine:
    DatesHelp!DHFunctions

    However, as soon as I saved it as an add-in, the combo boxes lost their contents. (There are other combo boxes on the forms also populated from named ranges, and these were similarly affected.) If I set the IsAddin property of the add-in to False while it's installed, the contents reappear!

    I've created add-ins before, but this is the first time that I've tried to use data saved on the add-in's worksheets in a userform. Is this normal behaviour for an add-in, and if not, how do I fix it?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Hi,

    Once you make the workbook into an add-in it is hidden so the add-in is no longer the active workbook. This means that you have to qualify the rowsource with the name of the add-in:

    eg
    [MyAddIn.xla]DatesHelp!DHFunctions

    Hope that helps...

  3. #3
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    Thanks for the reply.

    I tried your solution, but it did not accept that format as a valid row source. However, I came up with a work around, in which the source sheet is copied to the active workbook and then hidden from view.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  4. #4
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    Hi,

    If there are spaces in the workbook name then you need to enclose the workbook name and the worksheet name with ', just as you would in a formula.

    eg

    '[My Addin.xla]DatesHelp'!DHFunctions

    Hope that helps...

Posting Permissions

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