Excel互操作以在禁用宏的情况下打开Excel

在C#中是否有方法在加载excel文件之前关闭excel中的宏。我正在使用excel互操作加载excel文件。我所能看到的就是VB.NET的解决方案

谢谢
尼桑

我认为您可以在Excel应用程序中设置它:

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

发表评论