Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once it's turned the numlock on, I wouldn't think that code would do
anything next time you call it. However, it wouldn't take much to turn it into a toggle. Once you've got that, you can use Application.OnTime to call your sub something like this: Dim timTime As Date Sub UPDATE() Application.OnTime Now + TimeValue("00:10:00"), "startTimer" ' ' Do other stuff ' stopTimer End Sub Sub startTimer() ChangeState timTime = Now + TimeValue("00:10:00") Application.OnTime timTime, "startTimer" End Sub Sub stopTimer() Application.OnTime timTime, "startTimer", , False End Sub Timmothy Gransbury wrote: I have managed to find something that fixes a previous problem that I posted. I was trying to prevent the "inactivity logout" feature of our network while my code ran (it can take up to about 45 minutes). The code below is what I use, it toggles the "Number Lock Key" on and off. The question I have now is, I would prefer not to have to put this throughout the entire code (some 300 sheets). I would like to make it so that this code runs at a reqular interval, say every 10 minutes. I have tried some things that people have posted for "auto close" features, but nothing works. I don't want to to run when the workbook is open in general but only when the "UPDATE" code is ran (usually the first of every month). This code updates approx 300 files into other workbooks, creating some, and adding to others, it has many modules and probably over 100 macros all tied together with one main macro called "UPDATE". Sorry I am getting confusing. Basically whenever the macro "UPDATE" is ran I need something to run in the background and every 10 minutes run the code below. Thanks for your help on this, all of this is kinda new stuff for me, and least new uses for VBA. <snip |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Where is the number lock key on my HP Pavilion zv 6000??????????? | Excel Discussion (Misc queries) | |||
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? | Charts and Charting in Excel | |||
How do I keep result from 1 iteration cycle to use in next cycle? | Excel Discussion (Misc queries) | |||
Number Lock | Excel Discussion (Misc queries) | |||
How can I lock a number of cells within a worksheet? | Excel Discussion (Misc queries) |