Excel Interop打开Excel的macros,禁用macros

在加载excel文件之前,C#中有没有办法在excel中closuresmacros? 我正在使用Excel Interop加载Excel文件。 我能看到的只是VB.NET的解决scheme。

感谢Nishant

我想你可以在Excel应用程序中设置它:

Excel.Application xapp = new Excel.Application(); xapp.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable;