【问题标题】:Where is the VBComponents object in the Excel object model?Excel 对象模型中的 VBComponents 对象在哪里?
【发布时间】:2009-06-26 17:17:36
【问题描述】:

您好,我正在使用 c# 和 excel-2007... 我想在 excel 中添加一个宏并从 c# 运行,我认为我需要访问 VBComponents 但不幸的是我在执行以下操作后看不到它

    wb.VBProject.

我应该添加任何 com 对象吗?或者我应该怎么做才能看到 VBComponents...

我已经有了

    using Excel = Microsoft.Office.Interop.Excel;

    //wb is a workbook i can see VBProject but not other components of it...

【问题讨论】:

    标签: c# vba excel com-interop extensibility


    【解决方案1】:

    要添加 VBIDE,您似乎必须搜索 Microsoft Visual Basic for Applications Extensibility Library。详情请见here

    希望这些帮助。

    【讨论】:

    • 我已经使用 Excel = Microsoft.Office.Interop.Excel;
    • 我正在使用来自此站点eggheadcafe.com/articles/create_macro_at_runtime_in_dotnet.asp 的示例,他从 VBProject 获取 VBComponents,但在 wb.VBProject 之后我看不到 VBComponents。 (我什么也没看到)我的问题是如何获得 VBComponents
    猜你喜欢
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    • 1970-01-01
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    • 2011-02-28
    • 1970-01-01
    相关资源
    最近更新 更多