PC Review


Reply
Thread Tools Rate Thread

April Fools Programming, anyone?

 
 
Susan
Guest
Posts: n/a
 
      1st Apr 2009
found these on the internet over the years..................
====================
Private Sub Workbook_Open()
MsgBox "This message intentionally left blank"
End Sub
===================
Private Sub Workbook_Open()
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub
===================
Option Explicit

'this is the mouse joke function

Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
pstrReturnString As String, ByVal uReturnLength As Long, ByVal _
wndCallback As Long) As Long


Public Sub Out_Of_Cheese()

Dim Config As Integer
Dim Msg As String
Dim Ans As Integer
Call OpenCD
Config = vbOK + vbCritical
Msg = "Your mouse is critically low on cheese!!!" & vbCrLf & vbCrLf
Msg = Msg & "Insert now or workbook will be permanently lost."
Ans = MsgBox(Msg, Config)
ActiveWorkbook.Worksheets(1).Visible = True
'an all-black worksheet
ActiveWorkbook.Worksheets(1).Select
Call CloseCD
Config = vbOK + vbExclamation
Msg = "Insufficient cheese error!!!!!!" & vbCrLf & vbCrLf
Msg = Msg & "Workbook has been lost!!!"
Ans = MsgBox(Msg, Config)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ActiveWorkbook.Worksheets(1).Visible = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub


Sub OpenCD()
OpenOrShutCDDrive (1)
End Sub

Sub CloseCD()
OpenOrShutCDDrive (0)
End Sub


Sub OpenOrShutCDDrive(DoorOpen As Boolean)
Application.OnTime Now + TimeValue("0:30:00"), "OpenCD"
Dim lRet As Long
If DoorOpen Then
lRet = mciSendString("Set CDAudio Door Open", 0&, 0&, 0&)
'MsgBox ("Please Play Better Music")
Else
lRet = mciSendString("Set CDAudio door closed", 0&, 0&, 0)
End If

'lRet will = 0 upon success, so if you want to make this
'a function, return true if lret = 0, false otherwise
End Sub
=========================
susan

 
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
April Fools Ǝиçεl Spyware Announcements 29 8th Apr 2009 06:27 PM
April Fools 'hook' Duh_OZ Anti-Virus 1 1st Apr 2008 01:58 PM
April Fools! Mofaz DIY PC 4 3rd Apr 2007 08:35 PM
HAPPY April Fools Day! psd99 General Discussion 5 1st Apr 2005 05:19 AM
April Fools Edgar Microsoft Excel Programming 3 1st Apr 2004 08:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:45 PM.