ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sub in "thread" (https://www.excelbanter.com/excel-programming/321594-sub-thread.html)

M³ody

Sub in "thread"
 
Hello,

I need to have a sub, which`ll be run every 5 seconds. How can I do it in
VBA?
I tried with :
while loop
+doEvents
+getMilis (from "kernel.dll")

but it makes 100% CPU usage and blocks Excel.
Is there any metod similar to threads (Timer) or sth. like this?

Thanks in advance!



Bob Phillips[_6_]

Sub in "thread"
 
Look at OnTime in Help, and/or see http://www.cpearson.com/excel/ontime.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"M³ody" wrote in message
...
Hello,

I need to have a sub, which`ll be run every 5 seconds. How can I do it in
VBA?
I tried with :
while loop
+doEvents
+getMilis (from "kernel.dll")

but it makes 100% CPU usage and blocks Excel.
Is there any metod similar to threads (Timer) or sth. like this?

Thanks in advance!






All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com