문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top