Estimado antonio2005pe
Reemplaza todo el código del modulo, por el siguiente código
===========================================
Option Explicit
Private Enum Execution_State
ES_SYSTEM_REQUIRED = &H1
ES_DISPLAY_REQUIRED = &H2
ES_USER_PRESENT = &H4
ES_CONTINUOUS = &H80000000
End Enum
Private Declare Sub SetThreadExecutionState Lib "kernel32" (ByRef esFlags As Execution_State)
Const SPI_SETSCREENSAVETIMEOUT = 15
Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uiParam As Long, pvParam As Any, ByVal fWinIni As Long) As Long
Public Sub DoNotSleep()
'Sets the screen saver time-out value to the
'value of the uiParam parameter. This value is the amount of time,
'in seconds, that the system must remain idle before the screen saver activates.
'So, if you set it 30, it will suspend the screensaver & Power Off features for 30 minutes
SystemParametersInfo SPI_SETSCREENSAVETIMEOUT, 30, 0, 0
SetThreadExecutionState ES_CONTINUOUS Or ES_DISPLAY_REQUIRED Or ES_CONTINUOUS
End Sub
===========================================
Saludos, desde algún lugar de Lima-Perú