Code will open a new excel file (visible = False) and data will be entered then the excel file will be made visible(visible = True).
using oExcel = Microsoft.Office.Interop.Excel;
private void button1_Click(object sender, EventArgs e)
{
excelApp = new oExcel.Application();
excelApp.Visible = false;
excelApp.DisplayAlerts = false;
excelApp.AskToUpdateLinks = false;
wb = excelApp.Workbooks.Open(path);
ws = wb.Sheets[1];
}
Its showing error on ‘Visible’,’DisplayAlerts’,’AskToUpdateLinks’ and ‘Workbooks’
Error is as follows:
**”Severity Code Description Project File Line Suppression State
Error CS1061 ‘Application’ does not contain a definition for ‘AskToUpdateLinks’ and no accessible extension method ‘AskToUpdateLinks’ accepting a first argument of type ‘Application’ could be found (are you missing a using directive or an assembly reference?)”
**
suriya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.