title: Manipulate a file in code (VB.NET) without executing the file's macros
body: <p>I have an Excel file that has a bunch of VBA and macro code in it.  When I open the file in Excel I can choose not to 'enable' them - so the values in the fields all stay as they were during the last save.  I need to manipulate the values as they were last saved - so I don't want the macros (which look at the current date and update values accordingly) to run.</p>
  
  <p>When I open it via our dot net code: </p>
  
  <pre><code>Dim oxlRep As Excel.Application
  Dim oWBRep As Excel.Workbook
  Dim oSheetRep As Excel.Worksheet
  Dim oRngRep As Excel.Range
  oxlRep.Open(path)
  </code></pre>
  
  <p>the vb code runs - throwing off the values.  I've been looking for a way to open it without macros, or in 'secure' mode where the macros aren't run.  If I simply double click the file and don't choose to enable macros the values are all there as I want them.  </p>
  
  <p>Usually we run this code within the month that the files are created, so we haven't seen this problem in the 3 or 4 years that it has been working.  Now I need to go back to some of the old files and run some archival code...  </p>
  
  <p>Anyone have a suggestion?</p>