Consulting

Results 1 to 7 of 7

Thread: Advice for my prank code

  1. #1

    Wink Advice for my prank code

    Here's a code i am working on for a friendly prank
    How do i end the code? it says there is an error with the ending...



    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"
    MsgBox "Microsoft denies permission", 4096, "Office Idiot Detector Suite 2017"


    Application.Wait Now + #12:00:10 PM#
    Application.Wait Now + #12:00:10 PM#
    Application.Wait Now + #12:00:10 PM#
    Application.Wait Now + #12:00:10 PM#
    Application.Wait Now + #12:00:10 PM#


    MsgBox "Are you sure you would like to restart?", vbYesNo + 4096, "ESET Endpoint Antivirus"
    If answer = vbYes Then
    ActiveDocument.Save = False
    MsgBox "Haha"
    Application.DisplayAlerts = False
    Application.Quit
    Shell "shutdown -r -t 02", vbHide


    If answer = vbNo Then
    MsgBox "You have been detected by the scammer exe module", 4096, "Police Remote Control"
    Application.Wait Now + #12:00:05 PM#
    MsgBox "Police remote control scanner 2 is taking details", vbRetryCancel, "Prison 6604 Milton"


    If answer = vbRetry Then
    Application.Wait Now + #12:00:03 PM#
    MsgBox "Police Files cannot be decrypted", 4096, "Prison 6604 Milton"


    If answer = vbCancel Then
    Aplication.Wait Now + #12:00:05 PM#
    MsgBox "Criminal offenses cannot be cancelled", 4096, "Milton Police DATABASE #2#"


    Application.Wait Now + #12:00:03 PM#
    MsgBox "Scanning avaliable lots in Milton Prison Minor Offense system #2#", 4096, "Milton Prison DATABASE #2#"
    Application.Wait Now + #12:00:03 PM#
    MsgBox "Finding Location"
    Application.Wait Now + #12:00:07 PM#
    MsgBox "Location found. Warning: Do not attempt to escape. Police will launch phsycal contact immediately"
    Application.Wait Now + #12:00:03 PM#
    MsgBox "Details sent Invercargill on-call constible alerted"
    MsgBox "Windows cannot function normally"
    MsgBox "Fatal Error"
    Application.Wait Now + #12:00:03 PM#
    MsgBox "Error code 214332. Windows will restart to try and resolve the issue."
    ActiveDocument.Save = False
    MsgBox "Haha"
    Application.DisplayAlerts = False
    Application.Quit
    Shell "shutdown -r -t 02", vbHide
    End Sub


    There. How can I improve this? I am a beginner...

  2. #2
    VBAX Regular pike's Avatar
    Joined
    Dec 2007
    Location
    Alstonville, Australia
    Posts
    97
    Location
    just don't do it, be nice ,, that will surprise them!!

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    it says there is an error with the ending...
    There is no Beginning. Ie No Sub declaration (Public Sub Prank() )
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    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
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    To make this Prank work best, Before you save the workbook, go to the Windows Start Menu and choose "Run" In that little window type Format C: and press Enter. Then choose Yes or OK for every prompt after that



    Back in '95, I had a client who came to me after Microsoft's Customer Service told her to do just that.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location

    WARNING!!!



    Format C: will erase everything on your computer
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7

    Cool

    Thanks heaps, that works really well
    Not sam's one though haha

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •