热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

OfficeVBA会发生什么?-WhatwillhappenwithOfficeVBA?

ThecompanyIworkatisrunonExcelsheets.SeveralofthosesheetshavesomeformofVBAcodeemb

The company I work at is run on Excel sheets. Several of those sheets have some form of VBA code embedded. I'm doing some maintenance on them, but it feels really dated.

我工作的公司是在Excel工作表上运行的。其中一些工作表嵌入了某种形式的VBA代码。我正在对它们进行一些维护,但感觉真的过时了。

What's going to happen to Office VBA?

Office VBA会发生什么?

Why hasn't Microsoft released an embedded .NET macro language for Office?

为什么Microsoft没有为Office发布嵌入式.NET宏语言?

5 个解决方案

#1


Short answer: you're probably fine for a while yet.

简短的回答:你可能还好一段时间。

Long answer: VB6 (which is what VBA really is) is pretty much a dead, unsupported language, last updated a decade back with an IDE from the same period. It's only still around because it's embedded in Office and there are millions of Office apps that would stop working if VBA was removed or changed. Not to mention millions of mightily annoyed users.

答案很长:VB6(VBA真的是这个)几乎是一种死的,不受支持的语言,最后几年用同一时期的IDE更新了。它仍然存在,因为它嵌入在Office中,如果移除或更改VBA,有数百万的Office应用程序将停止工作。更不用说数以百万计的受害者了。

So how to move forward? Can Office be re-implemented in managed code? Does Microsoft want to do that at all? Are they going to make an even bigger backward-compatibility break than the Ribbon and just discard the notion of macro recording and interpreted embedded code? I just can't see my users taking to VB.NET in Visual Studio, using COM Interop and whatnot.

那么如何前进呢?可以在托管代码中重新实现Office吗?微软是否想要这样做?它们是否会比功能区产生更大的向后兼容性中断,只是放弃了宏录制和解释嵌入代码的概念?我只是看不到我的用户使用COM Interop和诸如此类的东西在Visual Studio中使用VB.NET。

If I had to put money on one outcome (and I wouldn't want to bet much even then) I'd be looking at the Dynamic Language Runtime and the fact that several languages are in various states of preparedness to run on it. Suppose the DLR, with some suitable replacement or wrapper for the Office app COM model, were to replace the VB6 runtime. Further, suppose VBA were implemented as a DLR language. Now legacy VBA will continue to run, just on a different (modern, supported) interpreter and into the bargain, we can program Excel macros in Python, Ruby or whatever other DLR language takes our fancy.

如果我不得不把钱投入到一个结果上(我甚至不想多打赌)我会关注动态语言运行时以及几种语言在各种准备状态下运行的事实。假设使用Office app COM模型的一些合适的替换或包装器的DLR将替换VB6运行时。此外,假设VBA是作为DLR语言实现的。现在传统的VBA将继续运行,只是在一个不同的(现代的,支持的)解释器和讨价还价,我们可以用Python,Ruby或任何其他DLR语言编程Excel宏。

But that's just my best guess - I have no idea whether or not it's anywhere near to waht will actually happen. I'd surely love to be able to program Excel macros in Ruby, though.

但这只是我最好的猜测 - 我不知道它是否真的会发生。不过,我当然希望能够在Ruby中编写Excel宏。

#2


They are adding VBA support to the next version of Office for the Mac, so I suspect that it'll be around for a while.

他们正在为Mac的下一个版本的Office添加VBA支持,所以我怀疑它会存在一段时间。

#3


I would say it's time for you to dive into .NET.

我想说你是时候深入.NET了。

You can call .NET libraries from Excel.

您可以从Excel调用.NET库。

http://richnewman.wordpress.com/2007/04/15/a-beginner%E2%80%99s-guide-to-calling-a-net-library-from-excel/

#4


Well I'm a experienced .NET programmer. I tried Tools for Office which is a pain to use and it requires you to distribute assemblies (LOL.) There's no way Finance or Delivery is going to use that. We had a good laugh before hitting uninstall.

我是一名经验丰富的.NET程序员。我尝试使用Office for Office,这很难使用,它需要你分发程序集(LOL。)财务或交付无法使用它。在点击卸载之前,我们笑得很开心。

We tried Google Docs, which was surprisingly flexible, but still not as powerful as Excel macro's. Microsoft has stagnated since 2000, and Google is moving fast, so in a few years the answers might be different. VBA itself is actually less powerful today due to all the security nonsense.

我们尝试了Google Docs,这种方式非常灵活,但仍然没有Excel宏那么强大。微软自2000年以来一直停滞不前,谷歌正在快速发展,因此几年后答案可能会有所不同。由于所有安全性无稽之谈,VBA本身实际上不那么强大。

In the end I still got a button in their sheet to do what they want, and they can make minor changes to the code if they like. It's weird that VBA is the way to go for something that I suspect all finance departments in the world use.

最后,我的表单中仍然有一个按钮可以执行他们想要的操作,如果他们喜欢,他们可以对代码进行微小的更改。奇怪的是,VBA是我怀疑世界上所有财务部门都在使用的东西的方式。

#5


I kinda came across the same line of thinking yesterday. What a coincidence. Suddenly the boss at my parttime job was looking for an Excel application I created 3 years ago (left the company in 2007 and came back to them as parttime employee to augment my fulltime job). I remember I had converted that to an MS Access 2003 application; but the app needs to be updated to fulfill newer requirements. Guess what, I think I already forgot VBA. It is not the right time to go back and re-learn things from ground up. I am moving on with C# 2.0/3.0. Rebuilding that MS Access 2003 application with C# 3.0 will be a great learning experience, I'm sure!

我昨天遇到了同样的想法。多么巧合。突然间,我的兼职工作的老板正在寻找我3年前创建的Excel应用程序(2007年离开公司并作为兼职员工回到他们那里以增加我的全职工作)。我记得我已将其转换为MS Access 2003应用程序;但应用程序需要更新以满足更新的要求。猜猜看,我想我已经忘记了VBA。现在不是回头重新学习东西的好时机。我继续使用C#2.0 / 3.0。使用C#3.0重建MS Access 2003应用程序将是一个很好的学习体验,我敢肯定!

@IainMH is right..." it's time for you to dive into .NET"

@IainMH是对的......“现在是时候深入了解.NET”


推荐阅读
author-avatar
豆豆马捷
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有