Pergunta

I am using Excel interop to perform manipulations on an existing Excel file. However, when I call Workbooks.Open(), it causes Excel window to open. Is it possible to prevent this, opening the workbook in memory only?

Foi útil?

Solução

Excel.Application app; // = your Excel application.
app.Visible = false;
app.DisplayAlerts = false;

The DisplayAlerts property is important to avoid having popups destined to the user. Especially if this code runs on a machine with no one to see the popup...

Outras dicas

Try setting ActiveWindow.Visible = False

Attention: If found a way to make the excel window visible when user has installed excel 2010. Does anyone know any ways to make the excel window visible with other excel version.

See my question and help to keep the excel windows hidden: C# Excel Interop prevent excel window from becoming visible

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top