+ Reply to Thread
Results 1 to 2 of 2

User-driven abort?

  1. #1
    Forum Contributor
    Join Date
    06-02-2005
    Posts
    100

    User-driven abort?

    Hi all,

    I have a procedure that randomizes data until certain criteria are met.

    Those criteria are user-driven, and if they enter in criteria that are too "tight" it could take a very long time for the randomization loops to compelte (and it's possible that they will NEVER compelte if the criteria are set too high)

    I'm using the status bar to show a loop count number (otherwise I have screenupdating set to false), but would like to instead have some sort of message box that shows the current loop count value and a big fat "Abort" button that lets the user stop the loop without using crtl-break

    Is this even possible in excel VBA? If it matters, screenupdating must be false, else the time it takes to execute a loop is too dependant on how fast the user's machine can redraw the data as it's randomized.

  2. #2
    Tom Ogilvy
    Guest

    Re: User-driven abort?

    In a tight loop, a button could be troublesome.

    Look at the EnableCancelKey property of the application.Object

    --
    Regards,
    Tom Ogilvy


    "Ouka" <Ouka.22h6jy_1138671001.1684@excelforum-nospam.com> wrote in message
    news:Ouka.22h6jy_1138671001.1684@excelforum-nospam.com...
    >
    > Hi all,
    >
    > I have a procedure that randomizes data until certain criteria are met.
    >
    >
    > Those criteria are user-driven, and if they enter in criteria that are
    > too "tight" it could take a very long time for the randomization loops
    > to compelte (and it's possible that they will NEVER compelte if the
    > criteria are set too high)
    >
    > I'm using the status bar to show a loop count number (otherwise I have
    > screenupdating set to false), but would like to instead have some sort
    > of message box that shows the current loop count value and a big fat
    > "Abort" button that lets the user stop the loop without using
    > crtl-break
    >
    > Is this even possible in excel VBA? If it matters, screenupdating must
    > be false, else the time it takes to execute a loop is too dependant on
    > how fast the user's machine can redraw the data as it's randomized.
    >
    >
    > --
    > Ouka
    > ------------------------------------------------------------------------
    > Ouka's Profile:

    http://www.excelforum.com/member.php...o&userid=23988
    > View this thread: http://www.excelforum.com/showthread...hreadid=506612
    >




+ 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