title: How to export to excel file with FileHelpers
body: <p>I am using <a href="https://nuget.org/packages/FileHelpers-Stable" rel="nofollow">File Helpers </a> and I am unsure how to take my data and export it to an excel file.</p>
  
  <p>I see a tutorial for<a href="http://www.filehelpers.com/example_exceldatalink.html" rel="nofollow">extracting records </a> but not creating a excel file.</p>
  
  <p>I tried to do this</p>
  
  <pre><code>ExcelStorage provider = new ExcelStorage(typeof(Img));
  
  provider.StartRow = 2;
  provider.StartColumn = 1;
  
  provider.FileName = "Customers.xls";
  
  provider.HeaderRows = 6;
  
  provider.InsertRecords(imgs.ToArray()); // imgs was a list before
  </code></pre>
  
  <blockquote>
    <p>System.IO.FileNotFoundException was unhandled by user code<br>
    Message=Could not load file or assembly 'Interop.Excel,
    Version=1.3.0.0, Culture=neutral, PublicKeyToken=3e0c08d59cc3d657' or
    one of its dependencies. The system cannot find the file specified.<br>
    Source=FileHelpers.ExcelStorage   FileName=Interop.Excel,
    Version=1.3.0.0, Culture=neutral, PublicKeyToken=3e0c08d59cc3d657<br>
    FusionLog==== Pre-bind state information === LOG: User =  LOG:
    DisplayName = Interop.Excel, Version=1.3.0.0, Culture=neutral,
    PublicKeyToken=3e0c08d59cc3d657  (Fully-specified) LOG: Appbase = 
    LOG: Initial PrivatePath =  Calling assembly :
    FileHelpers.ExcelStorage, Version=2.9.9.0, Culture=neutral,
    PublicKeyToken=3e0c08d59cc3d657.
    === LOG: This bind starts in default load context. LOG: Using application configuration file: web.config LOG: Using host
    configuration file:  LOG: Using machine configuration file from
    machine.config. LOG: Post-policy reference: Interop.Excel,
    Version=1.3.0.0, Culture=neutral, PublicKeyToken=3e0c08d59cc3d657 LOG:
    Attempting download of new URL file: LOG: Attempting download of new
    URL file:Interop.Excel.DLL. LOG: Attempting download of new URL
    file:Interop.Excel.DLL. LOG: Attempting download of new URL
    file:Interop.Excel.DLL. LOG: Attempting download of new URL
    file:Interop.Excel.EXE. LOG: Attempting download of new URL
    file:Interop.Excel.EXE. LOG: Attempting download of new URL
    file:Interop.Excel.EXE. LOG: Attempting download of new URL
    file:Interop.Excel.EXE.</p>
    
    <p>StackTrace:
           at FileHelpers.DataLink.ExcelStorage.InitExcel()
           at FileHelpers.DataLink.ExcelStorage.InsertRecords(Object[] records)
           at Index() in Controller.cs:line 37
           at lambda_method(Closure , ControllerBase , Object[] )
           at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
           at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
    controllerContext, IDictionary<code>2 parameters)
           at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
    controllerContext, ActionDescriptor actionDescriptor, IDictionary</code>2
    parameters)
           at System.Web.Mvc.ControllerActionInvoker.&lt;>c_<em>DisplayClass15.b</em>_12()
           at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
    filter, ActionExecutingContext preContext, Func`1 continuation)<br>
    InnerException:</p>
  </blockquote>