LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default April Fools Programming, anyone?

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fiscal year - April to March Brian222 Excel Discussion (Misc queries) 0 December 30th 10 10:15 PM
VLOOKUP 1st Friday in April and So On DOUG Excel Discussion (Misc queries) 1 April 8th 10 09:38 PM
April 1 alaskanrogue (Marc George) Excel Worksheet Functions 5 April 8th 05 05:40 PM
4 column sort... Fools rush in.... Neal Zimm Excel Programming 8 February 9th 05 12:31 PM
April Fools Edgar[_3_] Excel Programming 3 April 1st 04 08:54 PM


All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"