I want to open a workbook and cycle through the sheets in the workbook. Below is what I am trying, but it gives me an error of Object not set to an instance ofa n objet
Excel.Application oXL; Excel._Workbook oWB; wb = oXL.Workbooks.Open("WorkbookName", Missing.Value, true); { //This line throws the error on the oWB.Worksheets foreach (Excel.Worksheet displayWorksheet in oWB.Worksheets) { //more stuff here } }