1. You posted in Excel, but used ActiveDocument (MS Word)
2. More than a few syntax errors, and your logic is a little hinky since if you close the workbook, the macro will stop running
3. They have to have macros enabled
4. Put this in a Standard Module and the call to it in the 'ThisWorkbook' Open event
5. Pray that your friends are understanding and have a sense of humor, especially if they lose any work
6. I haven't tested it
Capture.JPG
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Doomed()
Dim i As Long
Dim answer As VbMsgBoxResult
For i = 1 To 5
Call MsgBox("Microsoft denies permission", vbCritical + vbOKOnly + vbSystemModal, "Office Idiot Detector Suite 2017")
Sleep 1000
Next i
Sleep 5000
answer = MsgBox("Are you sure you would like to restart?", vbYesNo + vbSystemModal, "ESET Endpoint Antivirus")
If answer = vbYes Then
ActiveWorkbook.Close False
MsgBox "Haha"
Application.DisplayAlerts = False
Application.Quit
Shell "shutdown -r -t 02", vbHide
Else
MsgBox "You have been detected by the scammer exe module", vbCritical + vbOKOnly + vbSystemModal, "Police Remote Control"
Sleep 5000
answer = MsgBox("Police remote control scanner 2 is taking details", vbCritical + vbRetryCancel + vbSystemModal, "Prison 6604 Milton")
If answer = vbRetry Then
Sleep 3000
MsgBox "Police Files cannot be decrypted", vbCritical + vbOKOnly + vbSystemModal, "Prison 6604 Milton"
Else
Sleep 5000
MsgBox "Criminal offenses cannot be cancelled", vbCritical + vbOKOnly + vbSystemModal, "Milton Police DATABASE #2#"
Sleep 3000
MsgBox "Scanning avaliable lots in Milton Prison Minor Offense system #2#", vbInformation + vbOKOnly + vbSystemModal, "Milton Prison DATABASE #2#"
Sleep 3000
MsgBox "Finding Location ....", vbInformation + vbOKOnly + vbSystemModal
Sleep 3000
MsgBox "Location found" & vbCrLf & vbCrLf & _
"Warning: Do not attempt to escape" & vbCrLf & vbCrLf & _
"Police will launch phsycal contact immediately", vbInformation + vbOKOnly + vbSystemModal
Sleep 3000
MsgBox "Details sent" & vbCrLf & vbCrLf & _
"Invercargill on-call constible alerted", vbInformation + vbOKOnly + vbSystemModal
MsgBox "Windows cannot function normally"
MsgBox "Fatal Error"
Sleep 3000
MsgBox "Error code 214332. Windows will restart to try and resolve the issue."
ActiveWorkbook.Close False
MsgBox "Haha"
Application.DisplayAlerts = False
Application.Quit
Shell "shutdown -r -t 02", vbHide
End If
End If
End Sub
BTW, a quick Google for "prank macros" turned up a lot of ideas. Example --
https://www.mrexcel.com/forum/lounge...ks-etc-45.html