【问题标题】:Excel Interop to open excel with macros disabledExcel 互操作以在禁用宏的情况下打开 excel
【发布时间】:2012-05-11 20:26:45
【问题描述】:

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

谢谢 尼桑特

【问题讨论】:

  • VB.NET 中的解决方案应该很容易移植到 C# - 你能发布一个例子,我敢肯定有人会很快翻译它。

标签: .net excel interop com-interop


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-03
    • 2012-06-09
    • 2016-05-27
    • 2014-12-01
    相关资源
    最近更新 更多