title: How to set AutoFit() to all sheets of Excel in c#
body: <p>How to set <code>AutoFit()</code> to all columns and all sheets of Excel in c#???</p>
  
  <pre><code>Excel.Range usedrange = wrkst.UsedRange;
  int ct = usedrange.Columns.Count;
  for (int i = 1; i &lt;= ct; i++)
  {
       app.Columns[i].AutoFit();
  }
  </code></pre>
  
  <p>the above code is not working for all columns and all sheets</p>