Tony,
Below are the answers to your questions:
1. Yes, if the user selects quick print, print from the office button, or print preview, my code cancels it and then loads a userform.
2. I have two buttons on the userform, both print a pre-selected print range.
3. The only purpose of the form is to print 1 of 2 ranges, nothing else.
4. Yes, if the user selects one of the buttons to print, all is good, no errors.
5. Yes, if they select any standard print / print preview commands while the form is open, various issues can occur. Also, if they select the standard print preview from the Quick Access or the Office button initially, the userform appears. From here if they select one of the buttons on the userform, the named range previews. Then if they select the print option from print preview and then cancel the print dialogue box, excel crashes. This is one of the reasons I want to disable print preview altogether or at least a work around.
6. I have two sheets that use the same type of userform and code, so it affects two different sheets.
7. Yes, I have a total of 5 sheets, three of them use the standard print range. So on these sheets, it's okay to use the standard print / preview command.
A brief synopsis of what this workbook is designed for:
Our restaurants take orders over the phone for various food items, one sheet is for bulk to-go orders and the second sheet is for regular menu orders. When the order is complete for either one, the manager has the ability to print two forms, one for the kitchen to ring the order in and the second form is so the manager can print and fax an order confirmation to the guest if they want a receipt. The form faxed to the guest is a cleaner version that only lists the guest's information and their order, while the first form for the kitchen lists the entire order form. Guests would not understand this form. This is why I created a userform so that the manager can have the ability to print these different ranges within the workbook.
I control all of this with "Private Sub Workbook_BeforePrint" on ThisWorkbook based off the name of the sheet.
Select Case ActiveSheet.Name
Case "Large Party"
If WorksheetFunction.CountA(Sheets("Large Party").Range("d4, d6, k4, D10, d12, k6, k8")) < 7 Then
MsgBox "You MUST fill out the below before Printing:" & vbCrLf & "" & vbCrLf & "Contact Name," & vbCrLf & "Contact Phone," & vbCrLf & "Number of Guests," & vbCrLf & "Gratuity %," & vbCrLf & "Day and Date of Party," & vbCrLf & "Time of Party," & vbCrLf & "and" & vbCrLf & "Party Planner/Manager Name" & vbCrLf & "" & vbCrLf & "Printing Cancelled!", vbExclamation
Cancel = True
Exit Sub
Else
Cancel = True
ActiveWindow.WindowState = xlMinimized
UserForm2.Show
End If
End Select
Again, thanks for your help in this.
Jon