使用 VBA 创建 Excel 2007 或 2010 自定义任务窗格

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23567045/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 03:04:53  来源:igfitidea点击:

Create Excel 2007 or 2010 custom task pane using VBA

excelvbaexcel-vba

提问by Nuno Nogueira

Is it possible to build a Custom Task Pane for Excel 2007 or 2010without Visual Studio, that is, using only VBA?

是否可以为Excel 2007 or 2010without构建自定义任务窗格Visual Studio,即仅使用VBA

I found this other questionbut it's not working for me.

我发现了另一个问题,但它对我不起作用。

回答by Skovly

I think, as of now, the answer to your question is "No".

我认为,截至目前,您的问题的答案是“否”。

As far as I can tell, extending any Office application (Excel, PowerPoint, etc.) with a Custom Task Pane / Application Pane requires a COM add-in, that needs to be developed with Visual Studio.

据我所知,使用自定义任务窗格/应用程序窗格扩展任何 Office 应用程序(Excel、PowerPoint 等)需要一个 COM 加载项,需要使用 Visual Studio 开发。

At least for Office 2007, this article (https://msdn.microsoft.com/en-us/library/aa338197%28v=office.12%29.aspx) specifically states that:

至少对于 Office 2007,这篇文章 ( https://msdn.microsoft.com/en-us/library/aa338197%28v=office.12%29.aspx) 特别指出:

(..) custom task panes are deployed as Component Object Model (COM) add-ins (..)

(..) 自定义任务窗格部署为组件对象模型 (COM) 加载项 (..)

The same article states that VBA does not support creating such custom task panes.

同一篇文章指出 VBA 不支持创建此类自定义任务窗格。

You can create custom task panes in any language that supports COM and that enables you to create dynamic-linked library (DLL) files, for example, Microsoft Visual Basic 6.0, Microsoft Visual Basic .NET, Microsoft Visual C++, Microsoft Visual C++ .NET, and Microsoft Visual C. However, Microsoft Visual Basic for Applications (VBA) does not support creating custom task panes.Custom task panes use other technologies with which you are already familiar, for example, Microsoft ActiveX controls.

您可以使用支持 COM 并允许您创建动态链接库 (DLL) 文件的任何语言创建自定义任务窗格,例如 Microsoft Visual Basic 6.0、Microsoft Visual Basic .NET、Microsoft Visual C++、Microsoft Visual C++ .NET和 Microsoft Visual C。但是,Microsoft Visual Basic for Applications (VBA) 不支持创建自定义任务窗格。自定义任务窗格使用您已经熟悉的其他技术,例如 Microsoft ActiveX 控件。

This article shows how to create a custom task pane with C# or VB in VS2013: https://msdn.microsoft.com/en-us/library/aa942846.aspx

本文展示了如何在 VS2013 中使用 C# 或 VB 创建自定义任务窗格:https://msdn.microsoft.com/en-us/library/aa942846.aspx

All in all, this article (https://msdn.microsoft.com/en-us/library/bb398242.aspx) states that you need Microsoft Office Developer Tools for developing office solutions, which is only bundled with

总而言之,这篇文章(https://msdn.microsoft.com/en-us/library/bb398242.aspx)指出您需要 Microsoft Office Developer Tools 来开发办公解决方案,该工具仅与

  • Visual Studio Professional
  • Visual Studio Premium
  • Visual Studio Ultimate
  • Visual Studio 专业版
  • Visual Studio 高级版
  • Visual Studio 终极版

If you only have VBA available it seems like your are stuck with the original User Forms for now.

如果您只有 VBA 可用,那么您现在似乎只能使用原始用户表单。

回答by user2958279

I'm looking the same question. I "think" the only way to make CTP is through VS. And only way to make in VBA is with userFrom instead of custom task pane.

我正在寻找同样的问题。我“认为”制作 CTP 的唯一方法是通过 VS。在 VBA 中制作的唯一方法是使用 userFrom 而不是自定义任务窗格。