Control Source syntax in Userform properties 
Author Message
 Control Source syntax in Userform properties

I want to define the control source for a combo box in a userform as a
worksheet range ("WorksheetName!B1:B12").  Every permutation of that that I
try is wrong:      "Could not set the control source property.  Invalid
property valid."

I know how to "add item" in the code, but how can I simply assign a
worksheet range to the Control source for the combo box in the properties
for the combo box?  (What is the required format?)

Thanks in advance.



Sat, 25 Dec 2004 00:35:17 GMT  
 Control Source syntax in Userform properties
Hi Splash,

Quote:
> I want to define the control source for a combo box in a userform as a
> worksheet range ("WorksheetName!B1:B12").

This property is only available within the Excel environment. You can't
use it in Word or Powerpoint, even though you want to connect to an
Excel source. It just doesn't work. Period.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Sat, 25 Dec 2004 16:51:04 GMT  
 Control Source syntax in Userform properties
Hi Splash,

Take a look at the article "Load a ListBox from a Named Range in Excel using
DAO" at:

http://www.mvps.org/word/FAQs/InterDev/FillListBoxFromXLDAO.htm

The same procedure will also work form a combo box.

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> I want to define the control source for a combo box in a userform as a
> worksheet range ("WorksheetName!B1:B12").  Every permutation of that that
I
> try is wrong:      "Could not set the control source property.  Invalid
> property valid."

> I know how to "add item" in the code, but how can I simply assign a
> worksheet range to the Control source for the combo box in the properties
> for the combo box?  (What is the required format?)

> Thanks in advance.



Sat, 25 Dec 2004 19:34:59 GMT  
 Control Source syntax in Userform properties
Hi, Cindy and Doug.

Thanks for the help, guys.  I will check out your suggested link, Doug.

Splash



Sat, 25 Dec 2004 23:11:50 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. File Syntax for SOURCE parameter, Tabular Data control

2. Can't see properties for Ax control on userform

3. Debug.Print Properties of Controls in Userforms

4. How to put a Form parameter in Adodc Control Record Source property

5. DBCombo Control Crashes System at Design Time (Record Source Property)

6. Properties window goes blank when Data Source property clicked- VB6 CR 7

7. linking Word data sources to userforms

8. 1 userform, 2 comboboxes, 2 source docs?

9. Need good source for winapi32 fuctions definitions and syntax:

10. Syntax for importing data into an Access table from an ODBC data source

11. Undocumented Properties of UserForms

12. Userform Visibility property in design time

 

 
Powered by phpBB® Forum Software