PC Review


Reply
Thread Tools Rate Thread

Disable screensavers from Excel

 
 
Andrew at Fleet
Guest
Posts: n/a
 
      27th Feb 2008
To whom it may concern,

Is there a way to disable the Windows XP screen saver from an Excel macro?
I'm using Excel 2003, and a "National Company" version of Windows XP where
the control of the screensaver has been removed from the users. When I'm
running an Excel macro over a large data file, the screensaver starts to
activate. As the CPU's resources are being used by Excel at the time, the PC
freezes. I'm wondering if there's some code that can be added to the macro
to prevent that.

--
Andrew
Telstra Fleet
Melbourne
Australia

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/communities...el.programming
 
Reply With Quote
 
 
 
 
Mark Ivey
Guest
Posts: n/a
 
      27th Feb 2008
Give this one a go...

I got this one from
http://groups.google.com/group/micro...5283ecbd9e0c60



I still think either a reboot or a logoff/logon may be required for this to
take effect.


Option Explicit

Sub DisableScreenSaver()
Dim WShShell, Value, Saved
Dim Password
'Password=Inputbox ("Enter Password")
'If Password <> "running" then Wscript.quit
Set WShShell = CreateObject("WScript.Shell")
On Error Resume Next
Value = WShShell.RegRead("HKCU\Control Panel\Desktop\ScreenSaveActive")
Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
Err.Clear
'MsgBox Value & "-" & Saved
On Error GoTo 0
If Saved <> "1" Then
WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSave", Value
WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "1"
WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive", "0"
End If
End Sub

Sub RestoreScreenSaver()
Dim WShShell, Value, Saved
Set WShShell = CreateObject("WScript.Shell")
On Error Resume Next
Value = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSave")
Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
Err.Clear
'MsgBox Value & "-" & Saved
On Error GoTo 0
If Saved = "1" Then
WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive",
Value
WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "0"
End If
'WScript.Quit (0)
End Sub



Mark Ivey


"Andrew at Fleet" <(E-Mail Removed)> wrote in message
news:4E1BCE9F-6468-4899-AD82-(E-Mail Removed)...
> To whom it may concern,
>
> Is there a way to disable the Windows XP screen saver from an Excel macro?
> I'm using Excel 2003, and a "National Company" version of Windows XP where
> the control of the screensaver has been removed from the users. When I'm
> running an Excel macro over a large data file, the screensaver starts to
> activate. As the CPU's resources are being used by Excel at the time, the
> PC
> freezes. I'm wondering if there's some code that can be added to the
> macro
> to prevent that.
>
> --
> Andrew
> Telstra Fleet
> Melbourne
> Australia
>
> ----------------
> This post is a suggestion for Microsoft, and Microsoft responds to the
> suggestions with the most votes. To vote for this suggestion, click the "I
> Agree" button in the message pane. If you do not see the button, follow
> this
> link to open the suggestion in the Microsoft Web-based Newsreader and then
> click "I Agree" in the message pane.
>
> http://www.microsoft.com/communities...el.programming


 
Reply With Quote
 
Andrew at Fleet
Guest
Posts: n/a
 
      27th Feb 2008
Mark,

Thanks for your help. I'll give it a go.
--
Andrew
Telstra Fleet
Melbourne
Australia


"Mark Ivey" wrote:

> Give this one a go...
>
> I got this one from
> http://groups.google.com/group/micro...5283ecbd9e0c60
>
>
>
> I still think either a reboot or a logoff/logon may be required for this to
> take effect.
>
>
> Option Explicit
>
> Sub DisableScreenSaver()
> Dim WShShell, Value, Saved
> Dim Password
> 'Password=Inputbox ("Enter Password")
> 'If Password <> "running" then Wscript.quit
> Set WShShell = CreateObject("WScript.Shell")
> On Error Resume Next
> Value = WShShell.RegRead("HKCU\Control Panel\Desktop\ScreenSaveActive")
> Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
> Err.Clear
> 'MsgBox Value & "-" & Saved
> On Error GoTo 0
> If Saved <> "1" Then
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSave", Value
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "1"
> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive", "0"
> End If
> End Sub
>
> Sub RestoreScreenSaver()
> Dim WShShell, Value, Saved
> Set WShShell = CreateObject("WScript.Shell")
> On Error Resume Next
> Value = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSave")
> Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
> Err.Clear
> 'MsgBox Value & "-" & Saved
> On Error GoTo 0
> If Saved = "1" Then
> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive",
> Value
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "0"
> End If
> 'WScript.Quit (0)
> End Sub
>
>
>
> Mark Ivey
>
>
> "Andrew at Fleet" <(E-Mail Removed)> wrote in message
> news:4E1BCE9F-6468-4899-AD82-(E-Mail Removed)...
> > To whom it may concern,
> >
> > Is there a way to disable the Windows XP screen saver from an Excel macro?
> > I'm using Excel 2003, and a "National Company" version of Windows XP where
> > the control of the screensaver has been removed from the users. When I'm
> > running an Excel macro over a large data file, the screensaver starts to
> > activate. As the CPU's resources are being used by Excel at the time, the
> > PC
> > freezes. I'm wondering if there's some code that can be added to the
> > macro
> > to prevent that.
> >
> > --
> > Andrew
> > Telstra Fleet
> > Melbourne
> > Australia
> >
> > ----------------
> > This post is a suggestion for Microsoft, and Microsoft responds to the
> > suggestions with the most votes. To vote for this suggestion, click the "I
> > Agree" button in the message pane. If you do not see the button, follow
> > this
> > link to open the suggestion in the Microsoft Web-based Newsreader and then
> > click "I Agree" in the message pane.
> >
> > http://www.microsoft.com/communities...el.programming

>

 
Reply With Quote
 
Andrew at Fleet
Guest
Posts: n/a
 
      27th Feb 2008
Hello Mark,

I think I can use this code. The location of the values with the registry
differs slightly, but I can update that. But, I do believe that I'll have to
reboot the PC to allow the changes to be saved. So, do you know of any code
to ask the user to reboot the PC? I would prefer a YesNo box that would
allow a choice, but I can add that later.

TIA
--
Andrew
Telstra Fleet
Melbourne
Australia


"Mark Ivey" wrote:

> Give this one a go...
>
> I got this one from
> http://groups.google.com/group/micro...5283ecbd9e0c60
>
>
>
> I still think either a reboot or a logoff/logon may be required for this to
> take effect.
>
>
> Option Explicit
>
> Sub DisableScreenSaver()
> Dim WShShell, Value, Saved
> Dim Password
> 'Password=Inputbox ("Enter Password")
> 'If Password <> "running" then Wscript.quit
> Set WShShell = CreateObject("WScript.Shell")
> On Error Resume Next
> Value = WShShell.RegRead("HKCU\Control Panel\Desktop\ScreenSaveActive")
> Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
> Err.Clear
> 'MsgBox Value & "-" & Saved
> On Error GoTo 0
> If Saved <> "1" Then
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSave", Value
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "1"
> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive", "0"
> End If
> End Sub
>
> Sub RestoreScreenSaver()
> Dim WShShell, Value, Saved
> Set WShShell = CreateObject("WScript.Shell")
> On Error Resume Next
> Value = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSave")
> Saved = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSaved")
> Err.Clear
> 'MsgBox Value & "-" & Saved
> On Error GoTo 0
> If Saved = "1" Then
> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive",
> Value
> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved", "0"
> End If
> 'WScript.Quit (0)
> End Sub
>
>
>
> Mark Ivey
>
>
> "Andrew at Fleet" <(E-Mail Removed)> wrote in message
> news:4E1BCE9F-6468-4899-AD82-(E-Mail Removed)...
> > To whom it may concern,
> >
> > Is there a way to disable the Windows XP screen saver from an Excel macro?
> > I'm using Excel 2003, and a "National Company" version of Windows XP where
> > the control of the screensaver has been removed from the users. When I'm
> > running an Excel macro over a large data file, the screensaver starts to
> > activate. As the CPU's resources are being used by Excel at the time, the
> > PC
> > freezes. I'm wondering if there's some code that can be added to the
> > macro
> > to prevent that.
> >
> > --
> > Andrew
> > Telstra Fleet
> > Melbourne
> > Australia
> >
> > ----------------
> > This post is a suggestion for Microsoft, and Microsoft responds to the
> > suggestions with the most votes. To vote for this suggestion, click the "I
> > Agree" button in the message pane. If you do not see the button, follow
> > this
> > link to open the suggestion in the Microsoft Web-based Newsreader and then
> > click "I Agree" in the message pane.
> >
> > http://www.microsoft.com/communities...el.programming

>

 
Reply With Quote
 
Mark Ivey
Guest
Posts: n/a
 
      28th Feb 2008
Although I have not tested these...

You might try one of these methods at:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=515


Mark Ivey

"Andrew at Fleet" <(E-Mail Removed)> wrote in message
news:47FCF9EE-BE47-4C19-B5D4-(E-Mail Removed)...
> Hello Mark,
>
> I think I can use this code. The location of the values with the registry
> differs slightly, but I can update that. But, I do believe that I'll have
> to
> reboot the PC to allow the changes to be saved. So, do you know of any
> code
> to ask the user to reboot the PC? I would prefer a YesNo box that would
> allow a choice, but I can add that later.
>
> TIA
> --
> Andrew
> Telstra Fleet
> Melbourne
> Australia
>
>
> "Mark Ivey" wrote:
>
>> Give this one a go...
>>
>> I got this one from
>> http://groups.google.com/group/micro...5283ecbd9e0c60
>>
>>
>>
>> I still think either a reboot or a logoff/logon may be required for this
>> to
>> take effect.
>>
>>
>> Option Explicit
>>
>> Sub DisableScreenSaver()
>> Dim WShShell, Value, Saved
>> Dim Password
>> 'Password=Inputbox ("Enter Password")
>> 'If Password <> "running" then Wscript.quit
>> Set WShShell = CreateObject("WScript.Shell")
>> On Error Resume Next
>> Value = WShShell.RegRead("HKCU\Control
>> Panel\Desktop\ScreenSaveActive")
>> Saved = WShShell.RegRead("HKCU\Control
>> Panel\Desktop\SaveScreenSaved")
>> Err.Clear
>> 'MsgBox Value & "-" & Saved
>> On Error GoTo 0
>> If Saved <> "1" Then
>> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSave",
>> Value
>> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved",
>> "1"
>> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive",
>> "0"
>> End If
>> End Sub
>>
>> Sub RestoreScreenSaver()
>> Dim WShShell, Value, Saved
>> Set WShShell = CreateObject("WScript.Shell")
>> On Error Resume Next
>> Value = WShShell.RegRead("HKCU\Control Panel\Desktop\SaveScreenSave")
>> Saved = WShShell.RegRead("HKCU\Control
>> Panel\Desktop\SaveScreenSaved")
>> Err.Clear
>> 'MsgBox Value & "-" & Saved
>> On Error GoTo 0
>> If Saved = "1" Then
>> WShShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive",
>> Value
>> WShShell.RegWrite "HKCU\Control Panel\Desktop\SaveScreenSaved",
>> "0"
>> End If
>> 'WScript.Quit (0)
>> End Sub
>>
>>
>>
>> Mark Ivey
>>
>>
>> "Andrew at Fleet" <(E-Mail Removed)> wrote in
>> message
>> news:4E1BCE9F-6468-4899-AD82-(E-Mail Removed)...
>> > To whom it may concern,
>> >
>> > Is there a way to disable the Windows XP screen saver from an Excel
>> > macro?
>> > I'm using Excel 2003, and a "National Company" version of Windows XP
>> > where
>> > the control of the screensaver has been removed from the users. When
>> > I'm
>> > running an Excel macro over a large data file, the screensaver starts
>> > to
>> > activate. As the CPU's resources are being used by Excel at the time,
>> > the
>> > PC
>> > freezes. I'm wondering if there's some code that can be added to the
>> > macro
>> > to prevent that.
>> >
>> > --
>> > Andrew
>> > Telstra Fleet
>> > Melbourne
>> > Australia
>> >
>> > ----------------
>> > This post is a suggestion for Microsoft, and Microsoft responds to the
>> > suggestions with the most votes. To vote for this suggestion, click the
>> > "I
>> > Agree" button in the message pane. If you do not see the button, follow
>> > this
>> > link to open the suggestion in the Microsoft Web-based Newsreader and
>> > then
>> > click "I Agree" in the message pane.
>> >
>> > http://www.microsoft.com/communities...el.programming

>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable the cancel option while saving the excel sheet-Excel 2007 Heera Microsoft Excel Programming 0 13th Jul 2010 10:10 AM
How can I disable Help in Excel help Microsoft Excel Misc 3 21st Oct 2009 06:40 PM
Need to disable a prompt in Excel when trying to programatically update links in a PPT Presentation that is linked to Excel shysue25 Microsoft Powerpoint 3 4th Nov 2005 01:57 PM
Need to disable a prompt in Excel when trying to programatically update links in a PPT Presentation that is linked to Excel shysue25 Microsoft Excel Programming 0 3rd Nov 2005 10:02 PM
Need to disable a prompt in Excel when trying to programatically update links in a PPT Presentation that is linked to Excel shysue25 Microsoft Powerpoint 0 3rd Nov 2005 09:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 PM.