有没有什么办法可以resuse XLAM插件的功能,在其他.NET项目? [英] Is there any way to resuse XLAM addin's function in another .NET project?

查看:223
本文介绍了有没有什么办法可以resuse XLAM插件的功能,在其他.NET项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了在VBA中,XLAM插件为Excel,和我建立另一个.NET项目。我需要解决同样的问题,完全XLAM了,我不想再这样写code(的)。

I have developed an XLAM addin for Excel in VBA, and I'm building another .NET project. I need to solve the same problem with completely XLAM, and I don't want to re-write this code (DRY).

请问有什么办法可以重新使用XLAM插件的功能,在其他.NET项目?

例如。在那之后我可以编译 xlam DLL 和导入.NET项目???

e.g. I can compile xlam to dll and import to .NET project after that???

推荐答案

Davuz,

转换XLAM到DLL的方法,不会出现随时可用。有一些方法可以共享在某些情况下不同的应用程序之间的功能,如写入其可以通过Excel和由VB.net共享COM函数。见此等问题,尤其是涉及到一个更深入的讨论意见:的 XLAM / XLA加载项:?有没有更好的办法

A method of converting XLAM to dll does not appear to be readily available. There are ways to share functions between different applications in certain cases, e.g. writing COM functions which can be shared by both Excel and by VB.net. See this SO question and especially the comments involved for a more in-depth discussion: XLAM / XLA Addins: is there a better way?

如果你想有插件具有的功能多层或共享的功能最大数量 - 从而最大限度地减少重复编辑/写 - 那我会认为这是多大的一个附加的设计问题,因为很多编码问题。这个MSDN链接揭示了设计外接更多的光: http://msdn.microsoft .COM / EN-US /库/ bb384200.aspx

If you want to have add-ins that have multiple layers of functionality or which share the maximum number of functions - thereby minimizing repeat edits/writing - then I would consider this as much of an add-in design issue as much of a coding issue. This MSDN link sheds more light on designing add-ins: http://msdn.microsoft.com/en-us/library/bb384200.aspx

所以,我认为,你应该考虑你将如何设计你的加载项与Windows应用程序一起工作,然后选择可以使用的办法,preferred应用尽可能多的桥梁转换尽可能 - 如上述COM方法。

So, I would argue that you should consider how you would design your add-in to work with the windows applications, and then select an approach which can be used to "bridge" conversion between the preferred applications as much as possible - such as the COM method mentioned above.

有关更直接的转换方法,那么它的比较VB的功能与.NET函数和通过直接比较它们自己的.NET同行重写那件事情 - 其中许多是由微软的高度记录。这当然不是遵循DRY原则一个完美的方式,但它比从头开始更好 - 但我觉得某些大家都知道这种做法已经是

For a more direct conversion method, then its a matter of comparing the VB functions with the .NET functions and rewriting those pieces by directly comparing them to their .NET counterparts - many of which are highly documented by microsoft. It is certainly not a perfect way to follow the principles of DRY, but it is better than starting from scratch - but I feel certain you are aware of this approach already.

祝你好运,

〜约尔

这篇关于有没有什么办法可以resuse XLAM插件的功能,在其他.NET项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆