Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: application.ontime

  1. #1
    Guest

    Default

    Hi. I hava the following problem:
    When I open a workbook, I use the application.ontime method to run a procedure after ten seconds. The procedure in the end, calls himself again, the same way as before.
    The problem is that when I exit my workbook without closing excel, it calls again my workbook, trying to run the procedure again. How can I avoid this?
    Thanks in advance,
    Luis.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Are you cancelling OnTime before your workbook closes? E.g.

    Application.OnTime , "YourProc", , False

    Where False cancels YourProc from being ran.

    If this isn't right then it might be worth posting your code.

    Regards,
    D

  3. #3
    Guest

    Default

    You need to stop the ontime procedure when you close the workbook with either an auto_close or workbook_close event. Read the following on better ways to set up ontime procedures.

    http://www.cpearson.com/excel/ontime.htm

    Cheers, Nate

  4. #4
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Whoops!

    C'est moi...C'est la vie!

  5. #5
    Guest

    Default

    Thanks a lot. Itīs workinh fine now.
    Regards,
    Luis.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •