将 VBA 转换为 .NET 语言
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8228659/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Convert VBA to a .NET language
提问by idm
Possible Duplicate:
Is it possible to convert VBA to C#?
可能的重复:
是否可以将 VBA 转换为 C#?
Suppose I have a big VBA project and want to convert it to a .NET language. Is there any way to do it automatically? Or maybe could I generate UML and a class structure, then append method bodies by hand?
假设我有一个很大的 VBA 项目并且想要将它转换为 .NET 语言。有什么办法可以自动完成吗?或者我可以生成 UML 和类结构,然后手动附加方法体?
回答by James Johnson
I don't think there's a provided way to migrate VBA to .NET, but there are conversion tools online that might help as a syntactical reference for parts of the code. This approach will be cumbersome, but it might still be easier than doing it all by hand.
我认为没有提供将 VBA 迁移到 .NET 的方法,但有一些在线转换工具可能有助于作为部分代码的语法参考。这种方法会很麻烦,但它可能仍然比手工完成更容易。
Here's an article that discusses migrating VBA to VB.NET:
http://msdn.microsoft.com/en-us/library/aa192490%28v=office.11%29.aspx
这是一篇讨论将 VBA 迁移到 VB.NET 的文章:http:
//msdn.microsoft.com/en-us/library/aa192490%28v=office.11%29.aspx
Converters
转换器
Here's a VB.NET to C# converter:
http://www.developerfusion.com/tools/convert/vb-to-csharp/
这是一个 VB.NET 到 C# 的转换器:http:
//www.developerfusion.com/tools/convert/vb-to-csharp/
And here's another one:
http://converter.telerik.com/
这是另一个:http:
//converter.telerik.com/
I don't know how helpful the converters will be since they're designed to convert .NET languages to other .NET languages, but seeing as how VBA and VB.NET do share some similarities, you might be able to use the converter for some of the code.
我不知道转换器会有多大帮助,因为它们旨在将 .NET 语言转换为其他 .NET 语言,但是看到 VBA 和 VB.NET 确实有一些相似之处,您可以将转换器用于一些代码。