在 C# 中是否有一种方法可以在加载 Excel 文件之前关闭 Excel 中的宏。我正在使用 Excel Interop 加载 Excel 文件。我只能看到 VB.NET 的解决方案。
谢谢 尼尚特
最佳答案
我认为您可以在 Excel 应用程序上设置它:
Excel.Application xapp = new Excel.Application();
xapp.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDisable;
关于.net - Excel Interop 在禁用宏的情况下打开 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10412470/