title: How to use Server.MapPath for Excel File
body: <p>Using Asp.Net MVC.</p>
  
  <p>I have one Excel file which has default styles, borders etc and it's name is MyExcel.xlsx. It opens  "C:\Users\myusername\Documents" from my local.</p>
  
  <p>Here is my C# code for it:</p>
  
  <pre><code>            Application excel = new Application();
              excel.Visible = true;
              Workbook wb = excel.Workbooks.Open("MyExcel.xlsx");
              Worksheet sh = wb.Sheets[1];
  </code></pre>
  
  <p>I uploaded my file to my Server 2012 like C:\MyExcel.xlsx. So i want to open server side MyExcel.xlsx file.</p>
  
  <pre><code>Server.MapPath("C:\MyExcel.xlsx");
  </code></pre>
  
  <p>But i get "Unexpected M" error. How can i fix this code?</p>
  
  <pre><code>&gt;         string myServerPath = Server.MapPath("C:\MyExcel.xlsx");
  &gt;         Application excel = new Application();
  &gt;         excel.Visible = true;
  &gt;         Workbook wb = excel.Workbooks.Open(myServerPath);
  &gt;         Worksheet sh = wb.Sheets[1];
  </code></pre>