linerif.blogg.se

Idling to rule the gods save file editor
Idling to rule the gods save file editor






Private Sub Workbook_SheetActivate(ByVal Sh As Object) Public Sub scheduledShutdown(pdteIdleStart As Date) If (pdteIdleStart = mdteIdleStartTime) ThenĪpplication.OnTime Now + TimeSerial(0, miWARNING_MINUTES, 0), "'scheduledShutdown #" & mdteIdleStartTime & "#'" Public Sub scheduledShutdownWarning(pdteIdleStart As Date)

#IDLING TO RULE THE GODS SAVE FILE EDITOR CODE#

WsIdleStart.Cells(1, 1).Value = pdteIdleStart '' worksheet's code name might need to be adjustedĭteClose = dteStart + TimeSerial(0, miMAX_IDLE_MINUTES - miWARNING_MINUTES, 0)Īpplication.OnTime dteClose, "'scheduledShutdownWarning #" & dteStart & "#'" Private Property Let mdteIdleStartTime(pdteIdleStart As Date) '' write value to hidden worksheet MdteIdleStartTime = wsIdleStart.Cells(1, 1).Value '' worksheet's code name might need to be adjusted Private Property Get mdteIdleStartTime() As Date '' read value from hidden worksheet Private Const miWARNING_MINUTES As Integer = 1 '' sets the time before shutdown at which a warning will be given Private Const miMAX_IDLE_MINUTES As Integer = 2 '' sets the idling time after which the workbook will be closed You have 5 minutes to save before Excel closes." MsgBox "This file has been open for " & TotalTime / 60 & " minutes.

idling to rule the gods save file editor

TotalTimeInMinutes = (TimeInMinutes * 60) - (5 * 60)ĭo While Timer < Start + TotalTimeInMinutes

idling to rule the gods save file editor

TimeInMinutes = 180 'Timer is set for 180 minutes change as needed. Thanks in advance!! God Bless! =)ĭim Start, Finish, TotalTime, TotalTimeInMinutes, TimeInMinutes Here is my faulty VBA code: Pls consider the two Message Box, I want to retain it coz it is cool. I want a VBA code that can allow you to open another excel file and auto saved after the end of specific time if you forgot to save. Another problem on this code is that, it will closed after the 2nd dialog box appear together with another excel files (if you have other excel files opened) and worst, the other excel file are not saved after it closed. You can't open another excel file if you have opened the excel file with VBA code, in short the window is locked up in the excel with VBA code when this is opened.

idling to rule the gods save file editor

I have a code that can close excel automatically if it is in idle mode, however, the result of the code is not that perfect.






Idling to rule the gods save file editor