+ Reply to Thread
Results 1 to 5 of 5

Detect if user hits cancel from user input type box

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,505

    Detect if user hits cancel from user input type box

    I have the following code which gets all the files in a director. The problem is if a user hits cancel then it exits the subroutine but my subsequent code does not know that cancel was hit.

    Any ideas on how to identify if cancel was hit...........


    Please Login or Register  to view this content.
    Last edited by welchs101; 10-21-2011 at 07:36 AM.

  2. #2
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,161

    Re: Detect if user hits cancel from user input type box

    If the subroutine is already exited, why do you want to let it know that cancel was hit?

    Also, i guess the code above -
    Please Login or Register  to view this content.
    takes care of finding out if the cancel was hit.
    Last edited by arlu1201; 10-17-2011 at 02:44 PM.

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2007
    Posts
    2,505

    Re: Detect if user hits cancel from user input type box

    ok, i figured it out..



    see code below

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,161

    Re: Detect if user hits cancel from user input type box

    If your query is resolved, please mark the Thread as Solved. Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

    If you found this post helpful, please rate it accordingly.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Detect if user hits cancel from user input type box

    FYI, you could also change the sub to a function that returns the array of files. The calling code can then just check if any files are in the array.
    Remember what the dormouse said
    Feed your head

+ 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