+ Reply to Thread
Results 1 to 4 of 4

Capture "cancel" on Standard Menu " close "

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Capture "cancel" on Standard Menu " close "

    Windows 10 running Excel 2003.

    I need to capture the cancel event when the "Cancel" button on the standard Menu/Close form is pressed.

    I'm using Menu/Close to exit a workbook (which contains VBA code) , and the "Yes" and "No" buttons work fine.
    However, the "Cancel" button isn't taking me back to the workbook's condition prevailing before it was pressed.

    So I need to capture it's event to see where it actually occurs in my code.

    Web trawls have produced nothing of use.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Capture "cancel" on Standard Menu " close "

    .
    Not certain I fully understand what it is you are requesting. Seeing your code would help greatly.

    Normally, when the user clicks on CANCEL, the code would include an "EXIT SUB" command. And, if necessary,
    clear any fields filled in prior to that point.

  3. #3
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Capture "cancel" on Standard Menu " close "

    Have now solved the problem by rearranging and re-locating some lined of code.
    Thanks for the inputs.

  4. #4
    Registered User
    Join Date
    05-16-2012
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Capture "cancel" on Standard Menu " close "

    You can try to put this in your macro to stop the cancel key.

    Application.OnKey "{ESC}", "" ' to disable Esc key

+ 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. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 2
    Last Post: 07-24-2017, 02:19 AM
  3. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  4. [SOLVED] Code Clean-Up: Delete "False" worksheet created when "Cancel" is chosen in Input Box
    By Kenny Blackwell in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 08-31-2015, 10:00 AM
  5. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  6. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  7. Capture "Cancel" from login request.
    By Claus Mygind in forum Excel General
    Replies: 0
    Last Post: 06-20-2005, 09:05 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