Error 380: could not set the rowsource property. invalid property value when changing the rowsource property

Hi,

VBA/Excel issue

I am encountering an issue where I get the error "could not set the rowsource property. invalid property value".

I have a listbox and change the elements it refers to depending on what options a user selects.

The first time I set the RowSource property, it works perfectly. If I add items to the referred worksheet and update the Rowsource property everything is fine. When I go to change it after adding something to the original list, then I get the error.

For example, I cannot change the Rowsource property from "Element1!G122:I124"
to "Element3!Q122:S128" - get the error.

In the watch window I try to forcably change it to "Element1!G122:I123" (ie. referring to one less row - a minor change), and the debugger gives me the same error. However I can change it to "" (Null)

Any ideas?

Thanks

Greg
gbergsmaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gbergsmaAuthor Commented:
I have no idea why this works, but when I create an object and set it to the form, and then set the rowsource property, it works

What the?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.