Outsmarting Screensavers: Keeping Your Computer Awake When Working From Home
Working remotely has its advantages-it gives you the flexibility to manage your time efficiently. But that annoying screen saver or computer hibernation can be a real nightmare when you step away from your desk. If you need to take a break, catch your breath, or just do something away from your computer without appearing away or in yellow in Microsoft Teams, we’ve got you covered!
For many remote workers, the notorious yellow status on Microsoft Teams, indicating inactivity, can be a source of frustration. But fear not! There are ways to keep your computer awake and maintain the appearance of activity.
A Coding Magic: Excel VBA to the Rescue
To prevent your computer from going to sleep or activating screensavers, you can use a simple script in Excel VBA that simulates keyboard input at regular intervals. The following code continuously sends the Tab key and then waits for 4 minutes and 50 seconds before repeating the process:
The key to be sent can be customized based on your preferences. Simply replace "{TAB}"
with the desired key code. For example, you can use "{RIGHT}"
, "{DOWN}"
, or any other valid key code.
Sub MySubroutine() Do While True ' Send the Tab key SendKeys "{TAB}" ' Wait for 4 minutes and 50 seconds Application.Wait Now + TimeSerial(0, 4, 50) Loop End Sub
Once the script is running, your computer will continuously send the Tab key, preventing any automatic sleep or screensaver activation. Feel free to pause the script when you’re back at your computer to resume normal functionality.
Where to paste this piece of code?
To effectively adopt this approach, follow these simple steps:
- Open Excel: Launch Microsoft Excel on your computer.
- Access the VBA Editor: Press
Alt + F11
to open the Visual Basic for Applications (VBA) editor. This can be found on the Develop tab. - Insert Module: In the editor, go to
Insert
and chooseModule
to insert a new module. - Paste Code: Copy and paste the provided VBA code into the module.
- Run the Script: Close the editor and run the script by pressing
F5
or choosingRun
from the menu.
Take back control of your workday
Take control of your work environment and say goodbye to frustrations caused by screensavers.
Happy coding and productive remote working!