title: Check whether an Excel workbook has macros using C#
body: <p>I need to go through hundreds of Excel files to find those that have macros, using a C# client.</p>
  
  <p>I have tried using the code in the accepted answer here:</p>
  
  <p><a href="https://stackoverflow.com/questions/36286289/using-interop-excel-to-check-if-excel-file-contains-vba-macros">Using Interop.Excel to check if Excel file contains VBA Macros</a></p>
  
  <p>However, this code opens the file first. Many of the files are opening pop up Windows and VBA error messages even after adding <code>_appExcel.DisplayAlerts = false</code></p>
  
  <p>Its also very slow. Is there a better way to go about this, ideally without opening the Excel file first?</p>
  
  <p>I have looked for documentation on MSDN for Excel interop here: <a href="https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.hasvbproject.aspx" rel="nofollow noreferrer">HasVBProject</a> but there are no examples I can work with.</p>