PDA

View Full Version : rowsource from excel sheet in a word VBA userform



matkooo
06-23-2008, 01:45 AM
hi,
my problem seems simple to me but i am a newbie. i want to set the rowsource of a combobox in my word document userform from an excel file. how do u do it? all i have got is this:

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "list1!a1:a2"
End Sub

This obviously works in an excel document but what i want is to work with the excel file as a editable database from word form. thanks in advance :think:

matkooo
06-23-2008, 02:47 AM
cmon guys, 9 of u looked at it and no one have had a comment? please, i am desperate. i have the whole application. the only thing i dont have is a place where from to get the rows of a combobox and where to store them.

Tinbendr
06-23-2008, 12:50 PM
Apparently you can't, despite what the help file shows.

See this (http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/fb054cf2147f2a5d/0264b4049b70c8c5?hl=en&lnk=gst&q=rowsource+excel#0264b4049b70c8c5) and this (http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/fc3a9b2ceecaec8/64665b0651f05317?hl=en&lnk=gst&q=rowsource+excel#64665b0651f05317).

There are other ways, like this (http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/dbeefbc784491a20/66ac4d9d6aae65cf?hl=en&lnk=gst&q=array+excel+listbox#66ac4d9d6aae65cf).