I am trying to access Excel file by code below:
Microsoft.Office.Interop.Excel.Application ObjExcel
= new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook book;
Microsoft.Office.Interop.Excel.Worksheet sheet;
Excel.Range range1 = null, range2 = null;
CultureInfo ci = new CultureInfo("en-US");
Thread thisThread = Thread.CurrentThread;
thisThread.CurrentCulture = new CultureInfo("en-US");
book = ObjExcel.Workbooks.Open(LinguisticInstructionsFileName);
At last line content of book variable is System.__ComObject
while in different app code is working and variable has ...Excel.WorkbookClass
.
So I would like to ask what might be the reason for this strange behavior. I already tried to call Workbooks.Open with extra Missing.Value args but result was the same.