+ Reply to Thread
Results 1 to 4 of 4

Closing a userform you disabled 'X' on... or stopping the macro

  1. #1
    Registered User
    Join Date
    10-04-2009
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    77

    Exclamation Closing a userform you disabled 'X' on... or stopping the macro

    Hi

    I used a piece of code to disable being able to close a userform with the conventional "X" but in this particular userform I also forgot to add a 'Cancel' button to close the userform...

    Added to this, when I tested, I did not have VB open, so I can't enter break mode and stop the macro... and I've not saved recently...

    Is there a way I can stop this macro running without closing the whole program and losing all my work? :-(

    Thanks
    Last edited by Smurlos; 03-20-2010 at 09:24 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Closing a userform you disabled 'X' on... or stopping the macro

    have you tried the Esc button?

    Personally,I find UserForms with the X disabled annoying.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-04-2009
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Closing a userform you disabled 'X' on... or stopping the macro

    I have indeed.

    I did a little search. Apparently, control and BREAK on your keyboard does the trick nicely :-) Brings up VB so that you can reset your project.

    As for the X being disabled. This is because I work with interfering colleagues who like to go in and alter things manually but they do not do so in the correct format i.e. you end up with dates like 12/1/10 instead of "12/01/2010" etc.

    Thanks
    Regards

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Closing a userform you disabled 'X' on... or stopping the macro

    As for the X being disabled. This is because I work with interfering colleagues who like to go in and alter things manually but they do not do so in the correct format i.e. you end up with dates like 12/1/10 instead of "12/01/2010" etc.
    I agree with royUK on disabling the "X". However, disabling the "X" does not prevent incorrect entries.

    If you want to control the format of entries then use code to check the entry or provide a calendar control to select the dates and format the selection accordingly.

    Further, apply protection to the VBA project to prevent tampering.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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