Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Linking an Active X Listbox to a worksheet list

I am working with userforms to modify a List on a worksheet, which now seems
to work fine. When the List has been modified, I wanted its updated version
to be reflected in an embedded Active X Listbox on another worksheet. This
doesn't happen automatically, although the Listbox is set up with the range
of the List as ListfillRange. So I tried re-linking the List to the Listbox
explictly using the ControlFormat property of OLEObjects / Shapes.

However, I get an error message "Object doesn't support this property or
method".
I can verify that it is indeed the Listbox my ControlFormat property is
referring to.
I also set up a watch on the object of the Listbox itself, and can see that
the ControlFormat properties are the ones consistent with a listbox. For
instance the ListFillRange is on the list of ControlFormats. But on the
watch, most of these properties are also marked with "Object doesn't
support..."

Basically I just need a function that let's my embedded Active X control
re-initialise itself from the named range it's already connected to through
its ListFillRange property on the Properties list.

Any ideas of what's the problem?
Any ideas of simpler ways to achieving the functionality I want?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Linking an Active X Listbox to a worksheet list

not tested but give this a try:

Dim strRowSource As String

strRowSource = Sheet1.Name & "!" & Sheet1.Range _
("A1", Sheet1.Range("A65536").End(xlUp)).Address

With Worksheets(1).OLEObjects("ListBox1")
.ListFillRange = vbNullString
.ListFillRange = strRowSource
End With
--
jb


"OleAtNordic" wrote:

I am working with userforms to modify a List on a worksheet, which now seems
to work fine. When the List has been modified, I wanted its updated version
to be reflected in an embedded Active X Listbox on another worksheet. This
doesn't happen automatically, although the Listbox is set up with the range
of the List as ListfillRange. So I tried re-linking the List to the Listbox
explictly using the ControlFormat property of OLEObjects / Shapes.

However, I get an error message "Object doesn't support this property or
method".
I can verify that it is indeed the Listbox my ControlFormat property is
referring to.
I also set up a watch on the object of the Listbox itself, and can see that
the ControlFormat properties are the ones consistent with a listbox. For
instance the ListFillRange is on the list of ControlFormats. But on the
watch, most of these properties are also marked with "Object doesn't
support..."

Basically I just need a function that let's my embedded Active X control
re-initialise itself from the named range it's already connected to through
its ListFillRange property on the Properties list.

Any ideas of what's the problem?
Any ideas of simpler ways to achieving the functionality I want?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Linking an Active X Listbox to a worksheet list

thanks, John,
I'll have a look at this, it may give some other clues.
but actually figured out what I did wrong in the meantime. Problem seems to
be that the ControlFormat property only applies to Control objects, not
Active X.
The Active X control can be referenced very simply:
Sheet1.ListBox1.ListFillRange = Range("r_WF_dataForListBox").Name

..ole

"john" wrote:

not tested but give this a try:

Dim strRowSource As String

strRowSource = Sheet1.Name & "!" & Sheet1.Range _
("A1", Sheet1.Range("A65536").End(xlUp)).Address

With Worksheets(1).OLEObjects("ListBox1")
.ListFillRange = vbNullString
.ListFillRange = strRowSource
End With
--
jb


"OleAtNordic" wrote:

I am working with userforms to modify a List on a worksheet, which now seems
to work fine. When the List has been modified, I wanted its updated version
to be reflected in an embedded Active X Listbox on another worksheet. This
doesn't happen automatically, although the Listbox is set up with the range
of the List as ListfillRange. So I tried re-linking the List to the Listbox
explictly using the ControlFormat property of OLEObjects / Shapes.

However, I get an error message "Object doesn't support this property or
method".
I can verify that it is indeed the Listbox my ControlFormat property is
referring to.
I also set up a watch on the object of the Listbox itself, and can see that
the ControlFormat properties are the ones consistent with a listbox. For
instance the ListFillRange is on the list of ControlFormats. But on the
watch, most of these properties are also marked with "Object doesn't
support..."

Basically I just need a function that let's my embedded Active X control
re-initialise itself from the named range it's already connected to through
its ListFillRange property on the Properties list.

Any ideas of what's the problem?
Any ideas of simpler ways to achieving the functionality I want?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox RowSource set to range of in-active sheet - possible? What-A-Tool Excel Programming 1 December 3rd 06 12:09 AM
bind data to active x listbox without macro Ram Excel Discussion (Misc queries) 0 September 11th 06 07:46 PM
Userform Listbox using an active sheet [email protected] Excel Discussion (Misc queries) 0 March 1st 06 08:22 PM
Multiselect ListBox - Active/Inactive Items LCK[_2_] Excel Programming 2 November 3rd 05 12:39 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"