+ Reply to Thread
Results 1 to 6 of 6

Runtime error 2110 - SetFocus on label not working

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Runtime error 2110 - SetFocus on label not working

    I'm trying to SetFocus on a userform label. I have this in the label click event. However I receive a Runtime error 2110?

    I have googled and can't work out why (the label is visible & enabled). So when google fails, I ask ExcelForum - someone here must know!

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Runtime error 2110 - SetFocus on label not working

    You cannot focus on a label...

    What are you trying to do that requires the label to have focus?

    Hope this helps

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Runtime error 2110 - SetFocus on label not working

    Quote Originally Posted by ajryan88 View Post
    You cannot focus on a label...
    I didn't know you couldn't set focus on a label. (It doesn't compile error )

    Quote Originally Posted by ajryan88 View Post
    What are you trying to do that requires the label to have focus?
    In the futile hope to bypass the issues I'm having with ActiveControl...

    See http://www.excelforum.com/excel-prog...multipage.html

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Runtime error 2110 - SetFocus on label not working

    How about a global declaration
    Please Login or Register  to view this content.
    and then
    Please Login or Register  to view this content.
    I hope this helps

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Runtime error 2110 - SetFocus on label not working

    Thanks for your help ajryan.

    I'm trying to avoid hard coding the control name inside its event procedure (which is why I was looking into ActiveControl in the first place) - it looks like I may have to go down that route after all.

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Runtime error 2110 - SetFocus on label not working

    You're welcome. Sorry it didn't turn out how you were hoping

    Have a great day and thanks for the rep

+ 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. Setfocus not working
    By Cbrehm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2011, 02:55 PM
  2. trying to SetFocus not working
    By bhofsetz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2008, 05:50 PM
  3. On Error GoTo Label in a loop only working once.
    By Ken Johnson in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-05-2006, 04:45 PM
  4. After sharing workbook VB code stops working. Runtime Error 1004
    By Patrick LaFerriere in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2005, 11:05 AM
  5. [SOLVED] setfocus sometimes gets error 2110
    By tmort in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2005, 11:05 AM

Tags for this Thread

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