+ Reply to Thread
Results 1 to 4 of 4

Listbox does not deselect or become disabled

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Question Listbox does not deselect or become disabled

    I have tried various approaches to deselecting items but the only way it seems to work is from outside the listbox commands. The idea is that if certain programs are open then the selection made by the user will be cleared and a message given. The message is given but the listbox never loses the selection nor does it become disabled.

    For the listbox click command I have the following:

    Please Login or Register  to view this content.
    What doesn't kill you is just biding it's time

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Listbox does not deselect or become disabled

    Do you want to allow the user to select multiple items from the list? What is the value for the MultiSelect attribute for this listbox? The code looks like it is intended to be Multi but if it is Single that could cause some issues.

    This is not causing your problem but delete this line:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you are not using Option Explicit this is a bug. I strongly recommend to everyone that they declare variables. Doing so prevents a lot of bug and runtime errors.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: Listbox does not deselect or become disabled

    No it is a single selection. The reason for it being cancelled is that a program is running that will interfere so has to be

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Listbox does not deselect or become disabled

    I reckon it's a problem with timing. you could try using application.ontime to run the code-either all of it or just the parts to deselect and disable
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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] Deselect all in multi-select listbox upon opening
    By ruub7 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 06-12-2017, 06:54 AM
  2. Deselect a Listbox
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2016, 03:27 PM
  3. [SOLVED] code to deselect if empty record is clicked in listbox
    By adelkam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2015, 02:07 PM
  4. [SOLVED] Listbox Automatic Deselect Bug
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-05-2013, 07:36 PM
  5. [SOLVED] Listbox remove disabled
    By Sniper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2012, 04:40 PM
  6. How do I deselect an item from a ListBox
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2010, 10:59 AM
  7. [SOLVED] ActiveChart.Deselect won't Deselect
    By Mark Stephens in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-15-2005, 10:05 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