title: Difference between print and print preview events in excel vba
body: <p>I have some code which intercepts the <code>Before_Print</code> 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.</p>
  
  <p>Is there any way to tell in the <code>Before_Print</code> code whether the user is actually printing or just previewing?</p>
  
  <p>The code that I currently have is (event stub was generated by excel):</p>
  
  <pre><code>Private Sub Workbook_BeforePrint(Cancel As Boolean)
      If Not Sheet2.CheckAllFieldsFilled Then
          Cancel = True
      End If
  End Sub
  </code></pre>