开发者

VBA in New Versions of Excel

Here is a question for my Father. He has been using VBA in Excel for more than two decades going from Excel 5 to this day where he is using Excel 2002.

As he has used VBA in Excel for so long, making extensive use of the ability to record macros, he has continued to invest in Excel as it has bee开发者_运维知识库n rather stable (in terms of its VBA functionality) across each version. Now, he is considering upgrading to a newer version of Excel, however I have read reviews that Microsoft completely botched their VBA interpreter in Excel 2007, as scripts that used to work in Excel 2003 or earlier would become painfully slow or stop functioning altogether. Then looking into Excel 2010, I've read that a lot of the issues with Excel 2007 "haven't been fixed". As I am not sure as to the credibility of these reviews, which I have read I am posing this question For all those folks out that are currently making heavy use of VBA in Excel:

Would it be advisable for someone who has a great deal of time and work invested in VBA from Excel 2002 or earlier to upgrade to either Excel 2003, 2007 or 2010?


There were several performance issues with Excel 2007 VBA. Many of these were fixed in Excel 2007 SP1. There were also a number of macro recorder problems with Charts and Shapes.

My personal recommendation would be Excel 2010: the VBA performance and Macro recorder issues have been fixed and I find the overall stability of Excel 2010 to be superior to most recent versions (but YMMV).

Migrating from Excel 2002 to 2007 or 2010 will involve learning to use the ribbon: some people like it and some people hate it, but it certainly will require effort for a long-term Excel user. Note that the VBA IDE has not changed.


If your father survived the migration to Excel 97, the switch to 2007 or 2010 will feel like a cakewalk. Other than the new GUI, the changes are of the more-better variety. I haven't run into any compatibility issues including the big jump from 97 to 2003.

To get up to date, I'd recommend John Green et al's Excel 2007 VBA Programmer's reference.


Most of the VBA/Excel programs that I developed in Excel 2003 work just fine in 2007 and newer without modification (It seems like I remember most issues being chart related). Of course it's possible that at least some of his recorded macros or hand coded VBA will not work in Excel 2007 and newer. However with a little debugging the old code can likely be converted without too much headache (search the line that errors and you will likely find out how to rewrite the line).

There are free add-ins such as UBitMenu and others to bring back the old style menu menu.

I wrote a benchmark for Excel VBA earlier this year that contains 6 different performance tests. The results submitted by 373 people so far clearly show that excel 2007 is the slowest of all versions. Among Excel 2003, 2007, 2003, 2002, Excel 2010 performs best on most tests followed by Excel 2003. Between 2010 and 2003 the composite results are fairly close, but the individual benchmark tests show that Excel 2003 is much faster at displaying data on a chart while 2010 is faster with complex VBA based calculations. The complete results from the benchmark are located at http://exceltrader.net/et2/benchMark.php.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜