Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

screen saver alert

Posted on 2013-02-05
3
Medium Priority
?
183 Views
Last Modified: 2013-09-25
I want to put off the screensaver working a macro in excel, which generates an event at regular intervals. is it possible
0
Comment
Question by:babisterzis
3 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 2000 total points
ID: 38856367
Hi, babisterzis.

Do you mean that you want a macro which will periodically do something which prevents the screensaver from activating? If so, the code below holds down the shift key for an instant every 5 seconds. It does this 10 times. Obviously both of these numbers can be changed as required.

I've successfully tested this with the Windows 7 screen-saver.
Option Explicit

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub Shift_Loop()
Dim i As Long

For i = 1 To 10
    Sleep 5000
    DoEvents
    Debug.Print i
    SendKeys "+", False
Next

End Sub

Open in new window

Regards,
Brian.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question