XP Screen Saver

T

Timmothy Gransbury

This question may seem a little strange, I have looked around but haven't found an answer that seems to work. I have a program in excel that I wrote that takes between 25 and 45 minutes to run (automates process and data collection and creating reports, hundreds of files). I use windows XP and at work, I ahve the problem of the screen saver kicking on part way through and it creates a problem for some of my code. It is a security issue for work, when the screensaver activates it locks the computer and you ahve to log back in to unlock it (and they won't change it). Is there a way to either disable this with VBA, or put something into my code (22 modules and over 300 pages) that will occasionally do something that will keep the computer active. I have screenupdating turned off for the whole process to help speed things along. Also if it matters I am running exccel 2002

What can I do ??

Thanks for your tim

Timmoth
Operations Assistant
 
J

John

Couldn't you just disable the screensaver using Control
Panel | Display settings.

If not, the only thing I can think of is try sending keys
using code. Look at the SendKeys function.

John
www.spreadsheetsolutions.com
-----Original Message-----
This question may seem a little strange, I have looked
around but haven't found an answer that seems to work. I
have a program in excel that I wrote that takes between 25
and 45 minutes to run (automates process and data
collection and creating reports, hundreds of files). I
use windows XP and at work, I ahve the problem of the
screen saver kicking on part way through and it creates a
problem for some of my code. It is a security issue for
work, when the screensaver activates it locks the computer
and you ahve to log back in to unlock it (and they won't
change it). Is there a way to either disable this with
VBA, or put something into my code (22 modules and over
300 pages) that will occasionally do something that will
keep the computer active. I have screenupdating turned
off for the whole process to help speed things along.
Also if it matters I am running exccel 2002.
 
H

Harald Staff

John

Some network policies re-enables the screensaver automatically at certain
intervals to ensure that all workstations are password protected after some
time of "inactivity" -unfortunately defined only as mouse/keyboard activity.

Best wishes Harald
 
I

Ivan F Moala

You could try using something like this to Turn OFF your screen saver...
then Turn it back ON

Private Declare Function SystemParametersInfo _
Lib "user32" _
Alias "SystemParametersInfoA" ( _
ByVal uAction As Long, _
ByVal uParam As Long, _
ByVal lpvParam As Long, _
ByVal fuWinIni As Long) _
As Long

Private Const SPI_SETSCREENSAVEACTIVE = 17

Public Function EnableScreenSaver(ByVal bStatus As Boolean) As Boolean
Dim lActiveFlag As Long
Dim lRetval As Long

lActiveFlag = IIf(bStatus, 1, 0)
lRetval = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, lActiveFlag, 0, 0)

If lRetval > 0 Then
EnableScreenSaver = True
Else
EnableScreenSaver = False
End If

End Function

Sub Tester()
MsgBox EnableScreenSaver(True)
End Sub
 
T

Timmothy Gransbury

That is the exact issue that I have, I just wish I could have been as clear as you were. Is there a way around it, I can't manually disable it. Will what John mentioned, "Send Keys", take care of the issue. If so I would appreciate some guidance

Thank

Ti

----- Harald Staff wrote: ----

Joh

Some network policies re-enables the screensaver automatically at certai
intervals to ensure that all workstations are password protected after som
time of "inactivity" -unfortunately defined only as mouse/keyboard activity

Best wishes Haral
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top