Excel Add-In [Issues while designing]

harpreetgujral

New Member
Joined
Oct 30, 2010
Messages
6
Hello everybody,

I am facing the following issues while working with Excel ADD_INs

1) i have designed an automation which makes allows the user to access the full Macro through a Excel ADD_IN

2) i have used a couple of forms in the the ADD_IN, which are saved in the ADD_IN file

3) The forms used have a couple of Drop_Down Boxes, in order to fill up these boxes with the Data, i am unable to pull data from the Excel ADD_IN file itself, so as a turnaround, i saved the data into another Excel file.

At present, i call the new excel file to open and then show the form to the user, this way i am able to populate the Drop Down Boxes placed on the Form present in the ADD_IN with the right data.

Is there a way to fill these Drop Down Boxes with the data i want the user to view from the ADD_IN file itself? [If there is an sample file, then please send it, i can replicate the concept from that ;)]

Thanks in advance
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
How much data are you talking about?

Could you just populate the comboboxes with code:e.g.
Code:
Private Sub UserForm_Initialize()

    With ComboBox1
        .AddItem "Apple"
        .AddItem "Orange"
        .AddItem "Pear"
    End With
    
End Sub
 
Upvote 0
You should be able to read data from an Add-in sheet as well.

Example:
Code:
x = Workbooks("[COLOR="Red"]MyAddIn.xla[/COLOR]").Sheets("[COLOR="Red"]Sheet1[/COLOR]").Range("A1").Value
 
Upvote 0
Thanks Alphafrog,

I cannot use the first alternative, since my data is a little huge, i mean about 85 options. So First solution is phased out

I tried using the second option, but the synatax where we use sheetname, i was using .xls in place of .xla, as suggested by you.

Will try using this option.....

Thanks for taking out time

Cheers
Harry
 
Upvote 0
Eighty items isn't too bad. You could put them into an array and then loop the array to add each item. This example does four items.

Code:
Private Sub UserForm_Initialize()

    Dim arrData1 As Variant
    
    arrData1 = Split("Apple,Orange,Pear,Peach", ",")
    
    For i = 0 To UBound(arrData1)
        ComboBox1.AddItem arrData1(i)
    Next i

End Sub
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top