This is very frustrating. I am using a Windows 7 machine with Excel 2010. I want to cancel printing a worksheet if there are too many pages. Thus I understand that I need to have code as follows:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If PageSetup.Pages > 2 then
Cancel = True...