将vba转换为vb.net [英] convert vba to vb.net

查看:191
本文介绍了将vba转换为vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码,我在word(宏)中使用VBA开发。我在VB.NET(2008)中尝试相同的功能,因为我试图将代码转换为VB.NET(2008)。我只是想知道这两种编程语言有多么不同。我尝试在网上查找一些简单的代码迁移内容,但找不到任何内容。如果您可以建议并分享如何开始这项工作,那将非常有帮助。

感谢U ............

解决方案

在这里你去



将代码从VBA转换为Visual Basic .NET [ ^ ]

将VBA转换为VB .Net和C# [ ^ ]


谢天谢地,VB.NET几乎没有任何共同之处使用VB6,只有非常基本的语法相似。范例完全不同,目标平台截然不同。首先,VB.NET是一种成熟的面向对象语言,.NET平台也是真正面向对象的。 (VB5最多可以被称为基于对象,这是最疯狂的限制。)虽然VB6可能没有什么好处,但VB.NET是一种不错的语言(在功能上稍微落后于C#),尽管绝对不是标准的,相比之下在ECMA和ISO下标准化的C#和C ++ / CLI。



因此,微软提供一些自动迁移方法令人惊讶。然而,据我所知,它并不太有效:对于或多或少复杂的项目,对转换代码的一些批判性审查和大量的手工工作是不可避免的。



-SA


 设置 xlb1 = xla1.Workbooks。打开(g_strTemplate)
设置 xls1 = xlb1.Worksheets( PIVOT


I have a code that I developed using VBA in word (macros). I am trying the same functionality in VB.NET(2008) as in I am trying to convert the code to VB.NET(2008). I was just wondering how different the two programming languages would be. I tried looking up online for some easy code migration stuff but couldnot find any. If you could suggest and share how to start working on this, It would be very helpful.
thank U............

解决方案

Here you go

Converting Code from VBA to Visual Basic .NET[^]
Convert VBA to VB .Net and C#[^]


Thanks goodness, VB.NET has almost nothing in common with VB6, there is only resemblance in very basic syntax. The paradigms are completely different, and target platforms are dramatically different. First of all, VB.NET is a fully-fledged object-oriented language and the .NET platform is truly object-oriented, too. (VB5 could be called "object-based" at best, which most crazy limitations.) While there is probably nothing good about VB6, VB.NET is a decent language (slightly behind C# in features), though absolutely not standard, in contrast to C# and C++/CLI which are standardized under ECMA and ISO.

So, it is amazing that Microsoft offers some automated migration method. However, from what I know, it's not too effective: for more or less complex project, some critical review of converted code and a good deal of manual work is unavoidable.

—SA


Set xlb1 = xla1.Workbooks.Open(g_strTemplate)
Set xls1 = xlb1.Worksheets("PIVOT")


这篇关于将vba转换为vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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