If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Rowsource for userform in Excel add-in not working

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-09, 07:13
weejas weejas is offline
Registered User
 
Join Date: Sep 2006
Location: Surrey, UK
Posts: 448
Red face 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.
Reply With Quote
  #2 (permalink)  
Old 12-30-09, 04:20
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
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...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #3 (permalink)  
Old 12-30-09, 05:09
weejas weejas is offline
Registered User
 
Join Date: Sep 2006
Location: Surrey, UK
Posts: 448
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.
Reply With Quote
  #4 (permalink)  
Old 12-30-09, 05:21
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
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...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On