+ Reply to Thread
Results 1 to 7 of 7

Prevent User from leaving form without a password

  1. #1
    Forum Contributor
    Join Date
    09-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    125

    Prevent User from leaving form without a password

    I have a job form which different user fill out during the day. I would like to prevent users from clicking anywhere or going anywhere outside the form while it is open and can only be closed or moved with a password. I have searched for a solution but can't find one, is this possible?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Prevent User from leaving form without a password

    You need to disable possibility to close userform with X button:

    Please Login or Register  to view this content.
    After that it will be possible only over buttons and there you can create macro as you like.

  3. #3
    Forum Contributor
    Join Date
    09-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Prevent User from leaving form without a password

    Thanks for the reply zbor. I can probably work out how to add a password to your code. But how do I stop the mouse pointer from leaving the bounds of the userform? Is it possible?

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Prevent User from leaving form without a password

    how do I stop the mouse pointer from leaving the bounds of the userform
    As long as the Userform is open it doesn't matter where the mouse pointer is because you can't click on anything (unless it's opened modeless)
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Contributor
    Join Date
    09-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Prevent User from leaving form without a password

    Quote Originally Posted by bakerman2 View Post
    As long as the Userform is open it doesn't matter where the mouse pointer is because you can't click on anything (unless it's opened modeless)
    Users can still access other programs and areas of the computer and this is what I want to stop them doing by keeping the focus/mouse pointer within the bounds of the userform, if that is possible.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Prevent User from leaving form without a password

    What your looking for is not possible since this would be controlling Windows programmation on Excel level.
    You want to controll mouse pointer but what about hotkeys? Windows-logo-M minimizes all open windows so desktop becomes visible. How are you gonna control that?

  7. #7
    Forum Contributor
    Join Date
    09-08-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Prevent User from leaving form without a password

    Quote Originally Posted by bakerman2 View Post
    What your looking for is not possible since this would be controlling Windows programmation on Excel level.
    You want to controll mouse pointer but what about hotkeys? Windows-logo-M minimizes all open windows so desktop becomes visible. How are you gonna control that?
    I didn't know, that's why I was asking.

+ 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. User Form - Auot close once Password and User name have been validated
    By christab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2016, 11:08 AM
  2. [SOLVED] Force data entry in cell with drop down list (i.e. Prevent user from leaving cell blank)
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-15-2014, 05:28 AM
  3. Prevent duplicates Excel user form
    By JSmith1504 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2014, 02:49 PM
  4. Match new password to specific user and update list via custom user form
    By Sargekd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2011, 09:40 AM
  5. Password protecting a user form
    By ducecoop in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2008, 04:53 AM
  6. prevent user moving form on screen
    By memphis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2007, 05:23 PM
  7. [SOLVED] prevent a user leaving a blank cell in excel2003
    By Ian Varty in forum Excel General
    Replies: 1
    Last Post: 04-15-2005, 09:06 AM

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