![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
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 |
|
Guest
Posts: n/a
|
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 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Whoops!
C'est moi...C'est la vie! |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Thanks a lot. Itīs workinh fine now.
Regards, Luis. |
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|