Excel Oddities


Return to The Spreadsheet Page

Excel page

User tips

Developer tips

Excel FAQs

Excel files

Excel Expert E-Letter

Excel Help Resources

Excel links

Excel oddities

Excel books

Power Utility Pak for Excel


XLM rears its ugly fead -- and crashes Excel

Caution: This will crash Excel. So if you try it, make sure you don't have any unsaved work.

Try this useless and strange tidbit:

Enter this simple procedure in the code module for ThisWorkbook:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
   Stop 
End Sub 
  1. Put something in the workbook (anything, so it will print)
  2. Click the Print Preview button.
  3. At the breakpoint, press F5. All is OK.
  4. Now try it again, but this time when you get to the Stop statement, keep pressing the F8 key, even after you return from the Print Preview. Somehow, you will be thrown into some ancient XLM code which doesn’t work (see the figure below) Anything you click on just turns bold! Time for the Three-Finger Salute.