Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This might be a little far fetched but I would like to
know how if it is possible to make my VBA program disable the windows screensaver at the beginning of execution and then enable it at the end. The reason is that the program seems to error out when the screensaver comes on. Jeff |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This nice little API function from Don Bradner seems to do the trick:
Private Declare Function SystemParametersInfo Lib "user32" Alias _ "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _ lpvParam As Any, ByVal fuWinIni As Long) As Long Sub SetScreenSaver(OnOff As Long) 'From Don Bradner Dim templong As Long Const SPI_SETSCREENSAVEACTIVE = 17 Const SPIF_UPDATEINIFILE = 1 Const SPIF_SENDWININICHANGE = 2 templong = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, OnOff, ByVal 0&, _ SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE) End Sub Sub MySub() SetScreenSaver 0 'your code here SetScreenSaver 1 End Sub -- Vasant "Jeff Armstrong" wrote in message ... This might be a little far fetched but I would like to know how if it is possible to make my VBA program disable the windows screensaver at the beginning of execution and then enable it at the end. The reason is that the program seems to error out when the screensaver comes on. Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disabling the cut function? | Excel Discussion (Misc queries) | |||
Can I display an Excel chart as my screensaver display? | Charts and Charting in Excel | |||
Problem with VB on screensaver | Excel Discussion (Misc queries) | |||
Macro run slow when turn on ScreenSaver | Excel Programming | |||
Auto_Open disabling | Excel Programming |