Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2015
    Posts
    174
    Thanks
    81
    Thanked 4 Times in 4 Posts

    Angry Painted Myself into a Corner with VBA Code

    I'm embarrassed!

    I worked on a file today for several hours and did something really dumb.

    I have a form where I wanted the user to click a close button instead of the red x. I added code so the red x isn't available. I also added code where the command button to close, quits
    and saves the application.

    Now I have a worksheet with an open form I can't close without quitting the application and I can't find a way to use Alt F11 with the form open.

    Is there a way out of this?
    Last edited by Excelnewbie; 2016-03-30 at 21:39.

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,396
    Thanks
    164
    Thanked 634 Times in 602 Posts
    Hi

    To access your code, you'll need to open that particular workbook file with macros disabled.

    Start Excel, select File> then point to the file and hold the [Shift] key down when you click the Open button.
    Alternatively, if your file is in the Most recently Used (MRU) list, hold the [Shift] key down when you click that file in the list.
    Then use [Alt][F11] etc etc etc

    There are other ways to do this.

    zeddy

  3. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,919
    Thanks
    152
    Thanked 746 Times in 678 Posts
    ...and no matter which method you use, your form must have some method to allow the user to close the form and exit the program
    Don't say I didn't warn you!

    Use CTRL-BREAK to stop the code and close the form
    Last edited by Maudibe; 2016-04-02 at 16:55.

  4. #4
    2 Star Lounger
    Join Date
    Apr 2015
    Posts
    174
    Thanks
    81
    Thanked 4 Times in 4 Posts
    I've been a way. I wanted to thank Zeddy for his help. It was very frustrating, but things worked out.

    Maud, yes you did warn me. It was a rewarding experience, one that I don't want to repeat. LOL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •