+ Reply to Thread
Results 1 to 3 of 3

Cancelling multiple Application.OnTime events when closing workbook problem

  1. #1
    Registered User
    Join Date
    08-23-2006
    Location
    Darlington, England
    MS-Off Ver
    Microsoft 365
    Posts
    33

    Cancelling multiple Application.OnTime events when closing workbook problem

    Hi

    I have the following code in 'ThisWorkbook object

    Please Login or Register  to view this content.
    I don't want the events to run when the workbook is closed but other workbooks remain open.
    The issue I have is when the first event runs 08:30, if I close the workbook I get a debug error on this line...
    Please Login or Register  to view this content.
    because the event is trying to be removed after it's already run.
    How can I work around this?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cancelling multiple Application.OnTime events when closing workbook problem

    Maybe add this line as the first action code:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-23-2006
    Location
    Darlington, England
    MS-Off Ver
    Microsoft 365
    Posts
    33

    Re: Cancelling multiple Application.OnTime events when closing workbook problem

    Quote Originally Posted by JBeaucaire View Post
    Maybe add this line as the first action code:

    Please Login or Register  to view this content.
    That did the trick, thanks.

+ 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. VBA - Application.Ontime Cancel Fails to Method 'ONTIME' of Object 'Application'
    By LordAzuRa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2016, 03:21 PM
  2. [SOLVED] Cancelling Application.ontime Error 1004
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2015, 08:24 AM
  3. Cancelling OnTime events problem
    By JamesFletcher in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-13-2013, 03:38 AM
  4. application.ontime problem
    By ckjason in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 05:58 AM
  5. Application OnTime Problem
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2012, 09:16 AM
  6. Problem with Application OnTime
    By P5C768 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2012, 04:14 PM
  7. Stopping Application OnTIme when closing a workbook
    By L2B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2005, 10:20 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