title: How to Improve Performance when Loading Data into Microsoft Project with VSTO
body: <p><strong>Background</strong></p>
  
  <p>We have an existing application which can load data into Microsoft Project so it can be manipulated by MS Project.</p>
  
  <p>The original application is an old-style COM Project add-in written by VB6 targeting on MS Project 2003 / 2007, and now we are planning to migrate them to VSTO add-in targeting MS Project 2013 / 2016.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>For them COM Add-in solution, we have encountered performance issue:</p>
  
  <blockquote>
    <p>Testing project has 4414 activities (av_activity table) and 8330
    relationships (av_reln table).</p>
    
    <p>Performance issues were reported during Load operation: </p>
    
    <blockquote>
      <p>Load time on MSP 2003 template for above project is apprx: 30-35 mins. </p>
      
      <p>Load time on MSP 2007 &amp; 2010 template is > 3hrs</p>
    </blockquote>
  </blockquote>
  
  <p>For VSTO solution it gets better but still we hope can improve the loading performance by some means.</p>
  
  <p><strong>What We Have Tried So Far</strong></p>
  
  <p>We have tried several tricks but didn't get much effect...</p>
  
  <ul>
  <li><p>Diable auto calculation during adding data</p>
  
  <p><code>_application.Calculation = PjCalculation.pjManual;</code></p></li>
  <li><p>Disable screen updating during adding data </p>
  
  <p><code>_application.ScreenUpdating = false;</code></p></li>
  <li><p>Disable change highlighting</p>
  
  <p><code>_application.EnableChangeHighlighting = false;</code></p></li>
  <li><p>Disable status bar</p>
  
  <p><code>_application.DisplayStatusBar = false;</code></p></li>
  <li><p>Set the Undo value to 1</p></li>
  <li>Set default View to "Task Sheet View" (instead of "Gantt View" which incurs more overhead during load).</li>
  </ul>
  
  <p><strong>Seeking Help For</strong></p>
  
  <p>I am seeking help for any solution on improving performance while loading data into MS Project with VSTO Add-in and C#.</p>
  
  <p>Thanks in advance!</p>