Question

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?

Was it helpful?

Solution

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...

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top