Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh Wise Ones,
Heres a bit of code from Jim Thomlinson that saves and closes a workbook after a set amount of time, but prompts the user for some more time. Works great. I have 2 questions though. 1) If multiple people share a computer, will the Windows Script Host Object Model flag be present for ALL people on that PC if it is set by the first person? 2) I and not a programmer, but I would guess that the Windows Script Host Object Model flag is set in the registry. Instead of running around to 30+ computers, can I package this in a reg file and email it out? Sub Auto_Open() Application.OnTime Now() + TimeValue("00:00:20"), "CloseMe" End Sub 'requires reference to "Windows Script Host Object Model" Public Sub CloseMe() Dim SH As IWshRuntimeLibrary.WshShell Dim Res As Long Set SH = New IWshRuntimeLibrary.WshShell Res = SH.Popup(Text:="Are you still there?", secondstowait:=2, _ Title:="Active", Type:=vbYesNo) If Res = vbYes Then Application.OnTime Now() + TimeValue("00:00:20"), "CloseMe" Else ThisWorkbook.Save ThisWorkbook.Close End If End Sub -- HTH... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2 Questions about the following code - Please help if you can. | Excel Programming | |||
Closing Workbook without Questions | Excel Programming | |||
Closing Code | Excel Programming | |||
Closing the VBA Editor using code | Excel Worksheet Functions | |||
[HELP] closing a program with VBA code | Excel Programming |