+ Reply to Thread
Results 1 to 3 of 3

application.ontime

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    Anaheim, California
    MS-Off Ver
    Excel 2010
    Posts
    22

    application.ontime

    Is there a way to handle canceling application.ontime without any using "on error resume next"? I would prefer to be able to tell if and event is scheduled, and if so, then cancel. If no event is scheduled, then do nothing. Thanks in advance for any help.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: application.ontime

    You could set a static (e.g. global) Boolean if your objective to prevent multiple invocations. Another idea, put logic, maybe time-driven logic, in pageFlipper to Exit Sub (guessing at your objective).

    BTW, from cpearson.com: "There is no way to tell Excel to cancel the next OnTime event or to cancel all the pending OnTime events." I'm unclear why he says that, since Schedule:=False would seem to do that; maybe he means that multiple OnTime events would have to have Schedule:=False set on each individually. AAR, I've never gotten Schedule:=False to work; I get the error myself every time.
    Chip, if you can read this, you're STILL making the world a better place with your immeasurably valuable gifts. Every week, you continue to help me (and untold numbers of others) tremendously. Practically no alternative outlets can match your effectiveness, even over the vast number of topics you demystify and empower usage of. You were, and still are, amazing.

  3. #3
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: application.ontime

    After further study I see why the error has occurred for myself. I have been using OnTime like a timer, basing the scheduled time on the function Now. Making the arguments match precisely lets the :=false work as desired.

    Assuming you weren't doing the same pinhead thing I was doing, and your arguments DO match, then I assume you get the error from multiple :=False invocations. So, back to my original suggestions. Try a Boolean.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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