让 ThisWorkbook 与 ThisAddIn 对话
我有一个包含 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就 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).