I have a VBA macro that I am trying to convert to C#. I am having trouble linking to the excel application and using the excel commands.
Below is a piece of the code I am trying to convert.
Dim myExcel As Excel.Application
Dim mySheet As Worksheet
Dim myWorkbook As Workbook
Dim FilePath As Variant
Dim myFile As Variant
Set myExcel = GetObject(, "Excel.Application")
Set mySheet = myExcel.Worksheets("sheetname")
I have tried adding the reference to Microsoft.Office.Interop.Excel
but cannot find the how a reference a particular sheet or cell in a sheet. I am trying to learn C#,
so your patience is very much appreciated along with any help.