title: Excel "Require Application Add-ins to be signed by Trusted Publisher" Breaks "ExcelWorkbook" Methods When Invoked From A Timer Thread On Activate
body: <p>I have an excel plugin that does a number of a things, one of them is on startup to open a window and after some user input add a new excel worksheet, like this:</p>
  <pre><code>currentWorksheet = ExcelWorkbook.Sheets.Add()
  </code></pre>
  <p>Normally works fine, no issues, however I'm attempting to deploy this to a environment that has the following excel option enabled:</p>
  <blockquote>
  <p><a href="https://admx.help/?Category=Office2016&amp;Policy=access16.Office.Microsoft.Policies.Windows::L_RequirethatApplicationExtensionsaresigned" rel="nofollow noreferrer">Require Application Add-ins to be signed by Trusted Publisher</a></p>
  </blockquote>
  <p>I can sign my file and install the plugin without issue, however when I run my code and I get to that line I get the following exception:</p>
  <blockquote>
  <p><a href="https://social.msdn.microsoft.com/Forums/en-US/9168f9f2-e5bc-4535-8d7d-4e374ab8ff09/hresult-800ac472-from-set-operations-in-excel?forum=vsto" rel="nofollow noreferrer">50290 - Exception from HRRESULT: 0x800AC472</a></p>
  </blockquote>
  <p>I'm not quite sure why this is, if I uncheck this option in excel(with the signed version of my plugin) it works fine, it's only when this option is enabled that I see this issue.</p>
  <p>Does anyone know why this would be the case? I don't understand how these two things overlap, does the &quot;Require Application Add-ins to be signed by Trusted Publisher&quot; option do anything other than validate that the file is signed?</p>
  <h1>Update 1</h1>
  <p>It actually seems like every call to &quot;ExcelWorkbook&quot; is failing with this same exception, I've demonstrated this issue with &quot;ExcelWorkbook.PivotCaches&quot; too, the key though is that is only results as a part of the &quot;AdxExcelAppEvents1_WorkbookActivate&quot; call or related methods, if I call these functions from a button click or by hand after the file has opened I do not see the same issue.</p>
  <p>One thing that's important to call out is that the thread that's throwing this exception is one that was invoked from a Timer function that was started during the &quot;AdxExcelAppEvents1_WorkbookActivate&quot; Method, such as with the following:</p>
  <pre><code>Private WithEvents ABCTimer As New Timer
  
  Private Sub AdxExcelAppEvents1_WorkbookActivate(sender As Object, hostObj As Object) Handles AdxExcelAppEvents1.WorkbookActivate
      ABCTimer.Start()
  End Sub
  
  Private Sub ABCTimer_Tick(sender As Object, e As EventArgs) Handles ABCTimer.Tick
      currentWorksheet = ExcelWorkbook.Sheets.Add()
  End Sub
  </code></pre>
  <p>This is what is erroring out, if I invoke from the main thread I don't see the issue.</p>