+ Reply to Thread
Results 1 to 7 of 7

Could not set the RowSource property. Invalid Property Value error when switching bet

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Mysore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Could not set the RowSource property. Invalid Property Value error when switching bet

    Hi,
    I am using VBA to store and get the data from Access database using Userforms.
    I used drop down and sub dropdown comboboxes for selection of items. 'Select case' option is used for better control of the comboboxs.
    The Rowsource data for both comboboxes are from 'name manager' defined in the same excel workbook.
    Combobox style is set to dropdowncombo.

    The problem is, when I switch between excel workbook and come back to main workbook where userform is running, I get the error while clicking on the listbox line item to select and edit.
    The application closes and again we have to start the macro. This happens only when we switch between workbook and come back.
    If we continue work with same workbook it works fine.
    Please somebody help to get rid of this.

    Link to other forum: Link
    Last edited by sathyaganapathi; 08-01-2021 at 08:22 PM.

  2. #2
    Registered User
    Join Date
    08-07-2012
    Location
    Mysore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    Hi,
    I have attached an example and error message I get and also the screenshot of error line.
    The error occures sometime when switching between other excel sheets which are open.
    Please note that, error line will change when clicking on different line in list box.
    Please help on this and let me know if more information is required.
    Attached Images Attached Images
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    Mysore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    Hi all,
    I could get some solution for this.
    Thanks a lot.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    work your way through the code in the attached file.
    do not use 'rowsource' it is the most unstable method of populating combo/listboxes.
    forget using 'name manager' - use tables they self maintain and their size is dynamically updated in 'name manager'
    leave userform controls (textboxes/combo/listboxes) at their default names - you can then loop through them to load.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  5. #5
    Registered User
    Join Date
    08-07-2012
    Location
    Mysore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    Dear torachan,
    Thank you very much for the input and also the sample worksheet. Need to go through it calmly and understand the code.
    I have to workout little bit to rewrite the code for my project as there are multiple comboboxs with linked sub comboboxs.
    One thing I observed is that, if I open the application I cannot click on any other excel that are working parallally.
    I cannot get/copy the info from other excel unless I close the userform. why is that?

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    in userform properties set 'Show Modal' to false, you can access anything in the background, take care that the app sheets are in view when you start reusing the form.
    You should copy in any data required prior to using the form unless you have written a process to import your data dynamically.

  7. #7
    Registered User
    Join Date
    08-07-2012
    Location
    Mysore
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Could not set the RowSource property. Invalid Property Value error when switching bet

    Dear torachan,
    got it... Thanks a lot. Let me try the code..
    Have great day..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Error 381Could not set the List property. Invalid property array index
    By desonny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2020, 08:33 AM
  2. Replies: 5
    Last Post: 06-02-2020, 04:56 PM
  3. Runtime error 381: Could not set the list property.Invalid property array index
    By rohith4prithvi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2014, 10:24 PM
  4. Run-time Error '380': Could not set the RowSource property. Invalid property value
    By Rem0ram in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2013, 03:57 PM
  5. [SOLVED] Excel run-time error '381': Could not set the List property. Invalid property array index
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2012, 12:48 PM
  6. Replies: 2
    Last Post: 06-11-2012, 03:03 PM
  7. Runtime Error 380 – Could not set the list property. Invalid property value
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2005, 05:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1