在excel中集成c#代码 [英] integrating c# code in excel

查看:92
本文介绍了在excel中集成c#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个excel文件,其中包含许多不同但非常相似的用户形式

当我点击一个单元格时在我的工作表中,将根据单元格文本打开一个特定的用户窗体。



我想知道是否有办法将ex#form添加到excel,这将表现为用户形式?

由于视觉工作室界面更简单,更通用,然后vb ...



谢谢

Hi all,

I have an excel file with many different, but very similar, userforms
When i click on a cell in my worksheet a specific userform will open according to the cell text.

I wanted to know if there is a way to add a c# form to excel which will behave as a userform?
Since the visual studio interface is much simpler and a lot more generic then vb...

Thanks

推荐答案

您有一些可能性:

1)实际上Excel(以及几乎所有Office应用程序)都支持加载项。因此,您可以创建遗留的Excel加载项。有几个教程,但这不是最简单的。

2)另一个有趣的方法: http:/ /exceldna.codeplex.com/ [ ^ ]

3)你可以从excel vba调用托管代码,但它不是最明智的代码,因为vba以一种相当不确定的方式运行。从这里开始: http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/ [< a href =http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/target = _blanktitle =新窗口> ^ ]

4) Interop Forms Toolkit [ ^ ]也许是另一种考虑因素。
You have some possibilities:
1) Actually Excel (and practically all Office application) support Add-ins. Thus you could make a legacy excel add-in. There are several tutorials out there, but this is not the simplest one.
2) An other interesting approach: http://exceldna.codeplex.com/[^]
3) You can call managed code from excel vba, but it is not the wisest one, since vba runs in a rather undeterministic way. Start here: http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/[^]
4) Interop Forms Toolkit[^] might be also an alternative to consider.


这篇关于在excel中集成c#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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