vba宏代码到c#代码 [英] vba macros code to c# code

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

问题描述

我需要将宏代码转换为我在excel中使用的c#代码我该怎么做????

解决方案

可能不是。你在谈论不同的平台,没有完全一对一的对应关系;他们实际上是非常不同的。您可以翻译代码的某些部分,这不是特定于平台或API的。



要在此字段中编写C#代码,您需要使用Microsoft Office Interop 。在安装Office之后,互操作程序集放在GAC中,您可以从Visual Studio的添加引用窗口的.NET选项卡中引用它。它将被命名为MS Office Interop Excel ...(适当版本)。



请参阅:http://msdn.microsoft.com/en-us/library/microsoft.office.interop .excel%28v = office.14%29.aspx [ ^ ]。



-SA

i need to convert a macros code to c# code that i used in excel how can i do dat???

解决方案

Probably not. You are talking about different platforms without total one-to-one correspondence; and they are actually very different. You can translate some part of code, which is not platform- or API-specific.

For writing C# code in this field, you will need to use Microsoft Office Interop. As after the installation of the Office the interop assemblies are put in GAC, you can reference it from the tab ".NET" of the "Add Reference" windows of Visual Studio. It will come under the name like "MS Office Interop Excel …" (of appropriate version).

Please see: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel%28v=office.14%29.aspx[^].

—SA


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

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