Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Microsoft has moved away from the COM stack, VB6 is so last century and .Net rules the (MS) roost. Yet I find myself still banging out reams of VBA code am I dinosaur? The need for VBA is a new project automating Excel seeing as you ask.

I've tried to doing the same kind of thing using VSTO and it was just too damn buggy/hard/inefficient with a broken development model. I can't get rid of the feeling that I'm missing something, OTOH I really can't see a better way of solving this problem. What are your thoughts?

share|improve this question
1  
Why do you need Excel to begin with? –  Job Jan 8 '11 at 4:41
5  
Oh come on is that a serious question? For many tasks a spreadsheet is absolutely essential, Excel is the best one available and everyone has it. –  MrTelly Jan 8 '11 at 5:00
2  
Everyone has Excel? Really? I see OpenOffice more and more on client computers and I made the switch myself a few years ago. –  Batibix Jan 8 '11 at 13:45
1  
"Eighty percent of enterprise customers are still using some version of Microsoft Office..." pcworld.com/businesscenter/article/166123/… –  Nick Jan 8 '11 at 22:01
2  
@MrTelly: Me neither. Literally every office I've ever worked at used MS Office. That said, I saw a stat from 2007 saying that 95% of the market was Excel. If both stats are true, competitors might be making headway, but as it is now Excel still dominates. –  Nick Jan 9 '11 at 6:12

3 Answers 3

up vote 7 down vote accepted

Of course there is still a need.

Why is .net the big thing? Because it makes visual app development quick and easy - MS learned all that from Borland and thus was born .net. (Borland used to have one of the few really easy visual dev environments that could make native win32 executables).

All these other things and tools are still needed - the need for native win32 apps is however something that incites passionate argument. I'd argue the need for Win32 native apps will never go away. That's a side issue, but related.

If you want to generate an app / automation for word, excel, access, visio, etc etc then VBA is fast, simple, and tightly integrated. Why should it go away? Heck you can still do Excel macros of the kind that went out of fashion 15 years ago. Nobody much does because there are other ways that are better/faster/easier to understand.

Each tool has its place - if trying to use somethind else in place of VBA takes longer / costs more / is more difficult then its effectively trying to jam square pegs in round holes.

The software business is FULL of people with Hammer Syndrome. You know the one: "To a man with a hammer the whole world looks like a nail." Well every new s/w technology has its mad keen devotees who think it will solve every problem known to man, and then some. They are always wrong. Always have been, always will be.

share|improve this answer
    
VBA is fast, simple, and tightly integrated - says it all –  MrTelly Jan 8 '11 at 7:07

I have lived with this problem for the last few years. VBA is pretty much dead, yet the VSTO model for me was just like you said: buggy, inflexible, and slow. So I saw it as a choice of getting the job done fast and effectively yet letting my professional skills stagnate, or getting the job done very painfully yet developing skills that will be around in the future.

My choice was the latter (VSTO), that is until Microsoft began changing their overall strategy starting about a year ago from proprietary only development (.NET), to embracing the rest of the development community (C++, javascript, html, etc). At that point the VSTO model of the future didn't seem so concrete. So I said screw it, went back to fast and easy VBA.

A few months later and my choice paid off: Microsoft announced Office 2013 "apps" or automation can be built in javascript. By looking at the other trends (Typescript, asp.net embracing js, html) it looks like this might be microsoft's preferred language for office going forward. It also looks like they won't be investing much in the VSTO platform moving forward.

So tl;dr: if you're primarily an office application developer, stick to vba, learn js when you get time and wait till your company upgrades to Office 2013.

Update:

So Office 2013 shipped and the Javascript api it came with is severely lacking in functionality. In it's current state, I don't believe it can replace VBA except for the most rudimentary applications.

share|improve this answer
    
Thanks for the heads up, I've got a beta of 2013 on my home laptop, and I for one can't see where the Javascript goes, VBA is still there just as before though. –  MrTelly Jan 8 '13 at 22:40
    
A shame they chose JavaScript, admittedly I'd prefer it over VBA and it can be a great language for scripts but really I would not like to make enterprise/business critical applications in it. Such a shame they havn't invested more in say IronPython/Ruby and integrate that with office. –  Richard Todd Jul 26 '13 at 9:33
    
Yeah. Python would be cool. I recently ran into a project called [link]datanitro.com which tries to do just that. Looks pretty cool, can hook your python excel scripts into full python libraries. One big downside though is it requires an install on every computer that might use the scripts, which removes it from consideration in the environment i work in. It also costs money. –  RMuesi Jul 26 '13 at 16:32

If you asked me that two days ago, I would have said no, VBA is totally on its way out. But the other day I opened up one of my old Excel applications and discovered that all the VBA declare statements were broken. Turns out Office 2010 included a new version of VBA, 7.0, which changed the syntax slightly. I was really surprised that MS released a new version and now I really wonder what its future will be. But even if VBA went the way of VB6, I think there would be a need for VBA development for quite some time given the sheer quantity of legacy office applications out there.

Personally, I have a pretty strong preference for vsto. I'm not a fan of VB's syntax, so it's nice to develop office applications with C#. Plus, using the office IDE feels like I'm coding in the dark ages. Now, I haven't done a HUGE amount of vsto development, but the biggest problem I've encountered is a relative lack of documentation for certain things. For example, it took me hours of googling the other day just to find a definitive list of callback signatures for the ribbon. There other reasons, but those are the first that come to mind. It's also possible that your difficulties with vsto are just related to re-learning how to do things. I know I had my fair share of frustrating moments trying to do something "simple" and having it take hours.

share|improve this answer
    
AFAIK the only changes in VBA 7 are related to 64 bit support. –  Foole Jan 8 '11 at 6:32
    
Really? (I didn't research it beyond fixing up my declare statements.) –  Nick Jan 8 '11 at 6:43
    
@Foole, you appear to be correct: stackoverflow.com/questions/3072356/… –  Nick Jan 8 '11 at 21:47
    
agree the documentation for office interop is really bad at times. –  Richard Todd Jul 26 '13 at 9:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.