title: Open and read Excel file in C# WPF application
body: <p>I am trying to open an Excel file located on my local computer and take out a few values from it. The values are a mix of strings and numbers located in different cells. The Excel file will be opened using <code>openFileDialog</code>. I am using C# and developing a desktop application (WPF). This is the code I am implementing:</p>
  
  <pre><code>     Excel.Application excelApp = new Excel.Application();
          string workbookPath = "C:/Users/b_prashanth/Documents/26. Workload Modeling generic template.xlsx";
          Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath);
          Excel.Sheets excelSheets = excelWorkbook.Worksheets;
          string currentSheet = "Sheet1";
          Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet);
          Excel.Range excelCell =
      (Excel.Range)excelWorksheet.get_Range("A1", "A1");
  </code></pre>