title: Run VBA macro whenever any workbook is opened
body: <p>I've created an Excel add-in that attempts to run upon the opening of any and all workbooks that are opened during this session.  It works sometimes - but not always, and I don't know why.</p>
  
  <p>I created a file, <code>addin.xlam</code>, and in this file, in <code>ThisWorkbook</code>, I have:</p>
  
  <pre><code>Private XLApp As CExcelEvents
  
  Private Sub Workbook_Open()
      Set XLApp = New CExcelEvents
  End Sub
  </code></pre>
  
  <p>I then created a class module based off the code here:  <a href="http://www.cpearson.com/Excel/AppEvent.aspx" rel="nofollow noreferrer">http://www.cpearson.com/Excel/AppEvent.aspx</a></p>
  
  <pre><code>Private WithEvents App As Application
  
  Private Sub Class_Initialize()
      Set App = Application
  End Sub
  
  Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
      If Not ActiveWorkbook Is Nothing Then
          If InStr(ActiveWorkbook.Name, "New Quote") Then
              quoteCheck = MsgBox("Do you want to run the Quote Generator?", vbYesNo, "Quote Generator")
              If quoteCheck = vbYes Then
                  prepare
              Else
                  End
              End If
          End If
      End If
  End Sub
  </code></pre>
  
  <p>If I close out of Excel and open a file from Windows Explorer, this line hits:</p>
  
  <pre><code>Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
  </code></pre>
  
  <p>And starts the code - if the workbook in question has "new quote" in its name, the macro runs.  Boom.  Perfect.</p>
  
  <p>However, after this runs ONCE, if I open another workbook with the words "new quote", this private sub doesn't trigger. Why?</p>
  
  <p>How do I get this to trigger <em>each time</em> I open <strong>any</strong> workbook?</p>