Skip to content

Instantly share code, notes, and snippets.

Dim objShell, lngMinutes, boolValid
Set objShell = CreateObject("WScript.Shell")
lngMinutes = InputBox("Hello! How long you want to keep your system awake?" & Replace(Space(5), " ", vbNewLine) & "Enter minutes:", "Awake Duration") 'we are replacing 5 spaces with new lines
If lngMinutes = vbEmpty Then 'If the user opts to cancel the process
'Do nothing
Else
On Error Resume Next
Err.Clear
boolValid = False
lngMinutes = CLng(lngMinutes)