+ Reply to Thread
Results 1 to 3 of 3

Disable keyboard or Enter Key during a msgbox

Hybrid View

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Disable keyboard or Enter Key during a msgbox

    How do I do this? I only want the user to use the mouse when one of my yes/no msgboxs comes up in the code. Some just enter through without realising.
    The below lines work for a workbook, but need it to work only when the msgbox is up so the user cant press ENTER.

    e.g.
    Application.DataEntryMode = True
    MSGBOX
    Application.DataEntryMode = False
    Help, this should be simple??

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

    Re: Disable keyboard or Enter Key during a msgbox

    I reckon you'd need api calls to do that but you could use a userform instead of a msgbox statement or add a non-functioning Help button and make it default
       MsgBox "my message", vbDefaultButton2 + vbMsgBoxHelpButton
    Josie

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

  3. #3
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Disable keyboard or Enter Key during a msgbox

    Second person to suggest using a help button as a default trap. Tried it.........and it actually works quite well. Cheers

+ 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. Disable mouse and keyboard while running a macro - mac
    By tartampion in forum Excel General
    Replies: 0
    Last Post: 05-17-2012, 07:56 PM
  2. Disable the msgbox beep?
    By lolelner in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-07-2010, 09:21 AM
  3. Disable mouse and keyboard
    By tapapad in forum Excel General
    Replies: 4
    Last Post: 10-08-2008, 04:41 PM
  4. Disable keyboard shortcuts in formula edit mode?
    By Dirk Van de moortel in forum Excel General
    Replies: 1
    Last Post: 12-16-2005, 11:10 AM
  5. Disable keyboard shortcuts in formula edit mode?
    By Dirk Van de moortel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2005, 11:10 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