วิธีแก้ให้ ใช้ Dynamic
Type typeExcel = Type.GetTypeFromProgID("Excel.Application");
dynamic excel = Activator.CreateInstance(typeExcel);
excel.Visible = true;
dynamic workbooks = excel.Workbooks;
workbooks.Add();
dynamic workSheet = excel.ActiveSheet;
workSheet.Cells[1, 1] = "Names";
workSheet.Cells[1, 2] = "Age";