I have some code which intercepts the Before_Print
event in excel to make sure that the user has filled in all the required fields before they print the sheet. However, I only want this code to fire when the user is actually printing, not when they are just calling the print preview.
Is there any way to tell in the Before_Print
code whether the user is actually printing or just previewing?
The code that I currently have is (event stub was generated by excel):
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Not Sheet2.CheckAllFieldsFilled Then
Cancel = True
End If
End Sub