title: ASP.NET C# - Excel Sheet to DataTable
body: <p>So, I have to export an Excel file, open it and to run a Macro that will format the Excel and I want to use it as a DataTable.
  I can't transform my file to a DataTable since it is already uploaded and I can't use the one that I uploaded from the file Upload</p>
  
  <p>I tried many things which they didn't work, like using various classes that I already have, but they only work for file upload files and not files like I am doing, the sheet after the vba macro.</p>
  
  <pre><code>var obj = Server.MapPath(upload_ficheiro.FileName);
              //~~&gt; Define your Excel Objects
              Excel.Application xlApp = new Excel.Application();
  
              Excel.Workbook xlWorkBook;
  
              //~~&gt; Start Excel and open the workbook.
              xlWorkBook = xlApp.Workbooks.Open(obj);
  
              //~~&gt; Run the macros by supplying the necessary arguments
              xlApp.Run("Audit");
  
  
  
              //~~&gt; Clean-up: Close the workbook
              xlWorkBook.Close(false);
  
              //~~&gt; Quit the Excel Application
              xlApp.Quit();
  </code></pre>
  
  <p>My code is like that and I tried various classes of my web application to transform it to a DataTable, imagine, I want to make it a datatable after the sheet is ran with the vba macro, which is only 1 sheet and 1 macro.</p>