Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with setting the ListFillRange in VBA


Hi,

As an experiment, I opened a blank sheet and added a combo box usin
the Control Toolbox. I named this combo box cboList. I then add
button and this code to it:

activesheet.shapes("cboList").controlformat.listfi llrange = "A1:A10"

When I ran the code, I got this error:

"Object doesn't support this property or method."

I looked up a few books on VBA for Excel programming as well as Exce
Help but got little help from them. This seems to be a very trivia
matter, and I don't know what else to try. I'll appreciate if anybod
can explain it to me.

Eventually, I would like to be able to read a list of values from th
database (using the add-in provided by the database) and assign a nam
to this list and then use the name for the listfillrange of my comb
box. I don't really need to use a name, but it'll make the rang
available in other parts of my application. I built eveyrthing already
The last hurdle I needed to get through is setting the listfillrang
using code.

Thanks for reading,
spacecitygu

--
spacecitygu
-----------------------------------------------------------------------
spacecityguy's Profile: http://www.excelforum.com/member.php...fo&userid=1106
View this thread: http://www.excelforum.com/showthread.php?threadid=31878

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with setting the ListFillRange in VBA


Instead of following Excel help to refer to my listfillrange as below:

worksheets(i).shapes(i).controlformat.listfillrang e = "R1C1"

which kept giving me the "object not defined" error.

I found out this will work:

worksheets(i).[name of my list box].listfillrange = "R1C1"

Sometimes I just don't understand how the object/class/property work
in VBA for Excel.

spacecitygu

--
spacecitygu
-----------------------------------------------------------------------
spacecityguy's Profile: http://www.excelforum.com/member.php...fo&userid=1106
View this thread: http://www.excelforum.com/showthread.php?threadid=31878

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with setting the ListFillRange in VBA


I failed to recognize the difference between ActiveX controls and M
Excel Form Controls

--
spacecitygu
-----------------------------------------------------------------------
spacecityguy's Profile: http://www.excelforum.com/member.php...fo&userid=1106
View this thread: http://www.excelforum.com/showthread.php?threadid=31878

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
ComboBox ListFillRange Stefi Excel Discussion (Misc queries) 14 April 21st 08 12:55 PM
Combo box - Listfillrange [email protected] Excel Discussion (Misc queries) 0 July 13th 07 09:51 AM
Strange problem with a combobox and ListFillRange teddyk Excel Discussion (Misc queries) 1 August 7th 06 09:16 PM
ListFillRange Dave Baranas Excel Programming 0 August 12th 03 05:09 AM
ListFillRange Dave Baranas Excel Programming 1 August 11th 03 11:08 PM


All times are GMT +1. The time now is 01:00 PM.

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"