No se puede convertir implícitamente el tipo 'objeto' a 'Microsoft.Office.Interop.Excel.Worksheet'. Existe una conversión explícita (¿falta un elenco?)
Aquí estoy abriendo excel y escribiendo para sobresalir hoja. Estoy cambiando mi aplicación de Windows al sitio web de ASP y he visto este error. He añadido todas las referencias y bibliotecas. No sé lo que me estoy perdiendo aquí.
Obteniendo el error como se menciona a continuación. Por favor, ayúdame.
Excel.Application excel = new Excel.Application();
excel.Visible = false; // to hide the processing
Excel.Workbook wb = excel.Workbooks.Add();
Excel.Worksheet sh = wb.Sheets.Add(); // Error at wb
sh.Name = "Links";
for (int i = 1; i < list.Count; i++)
{
sh.Cells[i.ToString(), "A"].Value2 = list[i]; //Error at .Value2
}