hi

Can someone please change this code as per my requirement . i want  that if
i am doing nothing in my workbook  its idle lets say for 3 or 4 minutes its
should automatically save and close it ...also let me know in which event i
have to put the macr workbook open or activate , etc.


Const idleTime = 10 'seconds

Public isActive As Boolean

Dim Start

Sub StartTimer()



Start = Timer

Do While Timer < Start + idleTime

DoEvents

Loop

If Not isActive Then

If MsgBox("Idle for " & idleTime & " seconds. Close workbook ?", vbOKOnly) =
vbOK Then

ActiveWorkbook.Close

Else

isActive = False

StartTimer

End If

End If

End Sub
-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to