Fix VBA Run-Time Error 380 When Setting a ListBox RowSource
Question details
The user encounters a Run-time Error 380 when a Word VBA macro attempts to assign an Excel worksheet range to a UserForm ListBox RowSource.

- Product
- VBA Macro / Word & Excel
- Device & OS
- not provided
- Scenario
- Automating cross-application tasks where a Word macro opens an external Excel workbook to extract range data and populate a ListBox control on a UserForm.
- Observed behavior
- The macro throws Run-time error 380 (Could not set the RowSource property. Invalid property value) despite the target Excel workbook and range being fully valid.
Ensure that the external Excel workbook is fully loaded and that your range variables are explicitly defined and instantiated before assigning them to any UserForm control.
Populate the ListBox Using the List Property (Recommended)
Bypass the cross-application limitations of the RowSource property by directly assigning the array of Excel range values to the ListBox's List property.
The RowSource property requires a string representing a valid range address. When triggering a UserForm in Word that pulls data from an external Excel instance, passing an external range address to RowSource often results in a property validation failure (Error 380). Directly assigning the values circumvents this application boundary.
Press Alt + F11 to open the Visual Basic for Applications (VBA) editor and locate the module or UserForm initialization code where the error occurs.
Find the line of code attempting to set the property, such as 'ListBox1.RowSource = rng2.Address', and delete or comment it out.
Replace the deleted code with a With block assigning the range values directly. Type: 'With ListBox1 .List = rng2.Value End With'.

Verify Range Dimensions and Array Boundaries
Ensure that the extracted Excel range does not contain structural issues or singular dimension arrays that clash with the ListBox expectations.
Write and Execute VBA Macros Seamlessly in WPS Office
WPS Office provides robust, built-in VBA support, allowing you to create UserForms, automate complex tasks, and cross-reference documents and spreadsheets without heavy resource consumption.
- 1. Enable Developer Tools: Open WPS Office, navigate to the 'Tools' tab, and click on 'Developer' to access the macro environment.
- 2. Access the VBA Editor: Click the 'Macro' or 'Visual Basic' button to open the WPS VBA Editor.
- 3. Import and Run Macros: Import your existing UserForms or write cross-application scripts seamlessly using standard VBA syntax.

Frequently Asked Questions
What specifically causes VBA Run-time Error 380?
Run-time Error 380 'Invalid property value' occurs when you attempt to assign a value to a property that is outside its acceptable parameters. In UserForms, this frequently happens when assigning an invalid string format or an inaccessible external range address to the RowSource property.
Why does RowSource fail when referencing a different application?
The RowSource property inherently expects a string referencing a range within the local application hosting the UserForm. When a Word macro tries to pass an Excel range string to a Word UserForm ListBox, the Word environment cannot natively resolve the Excel address, triggering the error.
How do I keep column headers when using the List property?
The .List property does not natively extract column headers from an Excel range like RowSource does. To replicate this UI, you must manually create Label controls and position them above the ListBox columns to act as static headers.




