Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Cycle Number Lock

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the number lock key on my HP Pavilion zv 6000??????????? deacongary Excel Discussion (Misc queries) 2 June 5th 10 04:41 PM
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
Number Lock garzayd Excel Discussion (Misc queries) 1 May 7th 06 02:43 PM
How can I lock a number of cells within a worksheet? IGA Excel Discussion (Misc queries) 4 February 25th 05 01:38 AM


All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"