Ok here's an unusual one that I need to know if possible.
I have a current workbook that is active most of the day. What I need is a macro or something that autosaves the workbook, then closes it if left idol for a period of time, say 15 mins.
Or another slant on this action, if the workbook is left idol for X time then some sort of cover sheet opens to hide the workbook until a password is entered, similar to a windows screensaver type action
Please if anybodys got any answers or other suggestions please let me know
This link may help
http://www.excelforum.com/showthread...=inactive+user
VBA Noob
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
ok tried this and cant seem to get it to work...(not brilliant with macros)
Any chance I could mail you the file so you can have a look. (Too much info / size to post)
Ok tried a few things and think i got it working now...all but one thing.
On closing it asks if i want to save instead of autosaving and closing
Did I miss something
Try this example
VBA Noob
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Thanx for the help as always![]()
No problem
Code used
In a normal module
In ThisWorkbookDim DownTime As Date Sub SetTime() DownTime = Now + TimeValue("00:00:20") Application.OnTime DownTime, "ShutDown" End Sub Sub ShutDown() ThisWorkbook.Save ThisWorkbook.Close End Sub Sub Disable() On Error Resume Next Application.OnTime EarliestTime:=DownTime, Procedure:="ShutDown", _ Schedule:=False End Sub
VBA NoobPrivate Sub Workbook_Open() MsgBox "This workbook will auto-close after 20 seconds of inactivity" Call SetTime End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Call Disable End Sub Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Call Disable Call SetTime End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target _ As Excel.Range) Call Disable Call SetTime End Sub
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Hello, this is my first post.
I use this code, but is there any way I can disable the warning without disabling the code?
We all know it is going to close at work so we don't need the warning anymore, it is just an annoyance.
Thank you.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks