Practical Jokes in Excel?

R

Ray

Hello -

What practical jokes have you played with Excel, either VBA or just
built-in features? With all of the creativity on this Board, I figure
there's got to be quite a few gems out there ...

One of my coworkers thinks he knows it all, so I'd like to punk
him ... my initial thought was a macro that would speak something
(using text-to-speech) or play a sound when a specific key is pressed
(say, the SHIFT or CTRL keys). I have absolutely no idea where to
start with this ... thoughts?

Looking forward to seeing what's been done before!

//ray
 
H

headly

Change the workbooks onopen event to change the windows time zone to India,
then all the users outlook appointments will be off 12 hours.
 
J

Jef Gorbach

Hello -

What practical jokes have you played with Excel, either VBA or just
built-in features?  With all of the creativity on this Board, I figure
there's got to be quite a few gems out there ...

One of my coworkers thinks he knows it all, so I'd like to punk
him ... my initial thought was a macro that would speak something
(using text-to-speech) or play a sound when a specific key is pressed
(say, the SHIFT or CTRL keys).  I have absolutely no idea where to
start with this ... thoughts?

Looking forward to seeing what's been done before!

//ray

macro one of excel's easter eggs then assign it a common shortcut.
 
S

Steve Yandl

This trick is benign but don't use it on your friend if he is prone to
panic. The sub is located in a worksheet rather than a module and the
trigger is selection of cell C2 (event was an arbitrary choice on my part).
There is a quick text to speech deployed to tell the user that selecting the
cell was a bad thing. Then an hta file (HTML application file) is created
in the temp folder and launched. This hta file doesn't do anything (no
script) but it's designed to open maximized with no caption and no scroll
bar. The effect of running the hta file is that the entire screen is filled
with whatever the normal background color for windows is (white in most
cases). The cursor will appear and can be moved but clicking the mouse or
attempting to type does nothing. The escape is the 'Alt + F4' combination
to close the active window and the user will be returned to the Excel sheet.
A Windows savvy user may also use Ctrl + Alt + del to get the task list,
locate mshta.exe and kill the process which has the same effect as Alt + F4.

'________________________________

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strNotify As String

strNotify = "Selecting this cell was a bad thing"

If Target.Address = "$C$2" Then
Application.EnableEvents = False
Set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak strNotify
Set fso = CreateObject("Scripting.FileSystemObject")
strHTAname = fso.GetSpecialFolder(2) & "\Temp000.hta"
Set txtHTA = fso.CreateTextFile(strHTAname)
With txtHTA
.WriteLine "<HTML>"
.WriteLine "<HTA:Application"
.WriteLine "Caption=" & Chr(34) & "no" & Chr(34)
.WriteLine "WindowState=" & Chr(34) & "Maximize" & Chr(34)
.WriteLine "Scroll=" & Chr(34) & "no" & Chr(34) & ">"
.WriteLine "</HTML>"
End With
Shell ("mshta.exe " & Chr(34) & strHTAname & Chr(34))
Set fso = Nothing
Set objVoice = Nothing
Application.EnableEvents = True
End If

End Sub

'________________________________
 

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