让 ThisWorkbook 与 ThisAddIn 对话

发布于 2024-08-27 02:20:01 字数 220 浏览 4 评论 0原文

我有一个包含 VSTO Excel AddIn 项目和 VSTO Excel Template 项目的解决方案。是否有任何设计模式(或黑客)可以允许 ThisAddIn 实例访问 ThisWorkbook 实例的属性和方法,反之亦然?

另外我应该注意,我使用的是 VS 2008、VSTO 2005SE,目标 Office 版本是 2003。

I have a solution containing an VSTO Excel AddIn project and an VSTO Excel Template project. Is there any design pattern (or hack) that can allow the ThisAddIn instance to access properties and methods of the ThisWorkbook instance, and vice versa?

Also I should note that I'm using VS 2008, VSTO 2005SE, and the target Office version is 2003.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

睫毛溺水了 2024-09-03 02:20:01

就 Excel 而言,插件就是工作簿。因此,如果您在外接程序代码中引用本工作簿,则您指的是该外接程序。

您始终可以引用其他 Excel 文件,但通常必须知道文件的名称(或者能够根据打开的工作簿得出文件名)。

Addins are workbooks, as far as Excel is concerned. So if you reference thisworkbook in the addin code you are referring to the addin.

You can always refer to other excel files but you generally have to know the name of the file (or be able to derive based on which workbooks are open).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文