SYMPTOMS
When you display a UserForm that contains a list box in Microsoft Excel 97,
the following problems may occur:
- The list box does not display any contents, even though it is linked
to a range of cells on a worksheet in the same workbook.
- The list box appears to be linked to the correct range of cells, however
the cells are in another workbook. As a result, the list box displays
the incorrect contents.
Also, when you change the RowSource property of a list box in a UserForm,
you may receive the following error message:
Could not set the RowSource property. Invalid property value.
RESOLUTION
To resolve this problem, change the RowSource property for the list box to
include the workbook name, the worksheet name, and the range that is used
by the list box. You can change the RowSource property for a list box by
selecting the list box and then double-clicking RowSource in the Properties
window of the Visual Basic Editor.
For example, if the RowSource property for a list box is as follows
change the RowSource property to the following
where <Book1> is the name of the workbook that contains the range of cells.
NOTE: The workbook to which the list box is linked must be open.
If you rename the workbook by changing its name in the Save As dialog box,
you must change the RowSource property of each of the list boxes.
Otherwise, the list boxes continue to refer to the original workbook name.
To prevent this problem from occurring, do not hide the workbook that
contains the range of cells to which the list box is linked. To unhide a
workbook, click Unhide on the Window menu, click the workbook you want to
unhide, and then click OK.