How to Fix Excel VBA Error 380: Invalid RowSource Property Value
Question details
The user is encountering VBA Error 380 ('Could not set the RowSource property. Invalid property value') and needs to correct the RowSource range string for a ListBox or ComboBox.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Setting up a UserForm in VBA with a ListBox or ComboBox that dynamically pulls data from a worksheet range.
- Observed behavior
- VBA triggers Error 380 because the RowSource property refers to an invalid worksheet range, an incorrect final row number, or a missing worksheet name.
Before modifying your VBA script, verify the exact name of the worksheet containing your list data and ensure that your data range is not completely empty.
Verify and Correct the RowSource Syntax
Ensure the worksheet name is accurate and the dynamic row variable evaluates to a valid number in your VBA code.
Error 380 typically occurs when a property value is mathematically or syntactically invalid. In the context of a UserForm, the RowSource property of a list box or combo box must specify a precise and existing Excel range.
Ensure the worksheet referenced in your RowSource string (e.g., 'Sheet1') exactly matches the tab name in your workbook. Check for accidental spaces.
If you are appending a variable like 'irow' to the range string, confirm that it contains a valid numeric value greater than zero. The correct syntax should look like: .lstDatabase.RowSource = "Sheet1!A2:L" & irow.
Temporarily replace your dynamic RowSource with a hardcoded string, such as .lstDatabase.RowSource = "Sheet1!A2:L100". If the form loads without Error 380, your dynamic variable is failing to calculate the correct row number.

Debug and Run VBA Macros Easily with WPS Spreadsheet
WPS Office provides robust support for VBA macros. You can edit, debug, and execute your customized UserForms and macros using its intuitive built-in VBA editor.
- 1. Open your macro-enabled workbook: Launch WPS Spreadsheet and open your .xlsm file containing the VBA code.
- 2. Access the Developer Tools: Navigate to the 'Developer' tab on the top ribbon menu.
- 3. Launch the VBA Editor: Click on 'Visual Basic' or 'Macros' to open the code editor.
- 4. Fix and Run: Locate your UserForm code, correct the RowSource property syntax, and click the 'Run' button to test your form seamlessly.

Frequently Asked Questions
What does Error 380 'Invalid property value' mean in VBA?
This error occurs when you attempt to assign a value to a property that falls outside its acceptable format or range. For UserForms, it usually means the RowSource string is formatted incorrectly, points to a non-existent sheet, or references an invalid cell coordinate.
How do I dynamically find the last row for my RowSource?
You can find the last used row by using the script: irow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row. Assign this to your variable before setting the RowSource.
Why does my RowSource work with a hardcoded range but fail with a variable?
This happens if the variable is uninitialized, evaluates to zero, or returns an empty string at the exact moment the RowSource property is set. Ensure your variable calculation is placed before the RowSource assignment in your script.




