Solved

screen saver alert

Posted on 2013-02-05
3
172 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 500 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now