tags:

views:

485

answers:

5

My background: Mostly C programming. I have some (very recently...last 2 months) acquired JAVA (novice) skills. All my limited experience is based on developing for linux.

I would like to do some excel programming for work purposes. My main interest is in starting to create "dashboards" and charts/reporting from excel sheets as I'm sick and tired of updating many sheets by hand. I'm lazy so I love to automate wherever I can :-)

Which one of these "new" languages (for me) would you recommend to learn? I'm also hoping that if/when I'm getting more familiar with Windows/MS Office environment I can do more "powerfull" things.

+6  A: 

I personally prefer C# as a language, but in terms of released versions, VB.NET is a better language to use for Office interop. C# 4 has improved this situation a lot though, with named arguments and optional parameters, ref argument faking and COM PIA linking.

If you can use C# 4, that might be the best option for you - but if you're stuck with fully released versions, you might want to go for VB.NET instead.

Jon Skeet
Hi Jon. Not sure what you mean with "fully released versions". My requirements are to use this only for myself, so it's not somethingthat's going to be supported through the company or by anyone else. Mostly to scratch my own itch.
NomadAlien
I mean "versions which aren't in beta" :) If you're happy using the beta 1 of Visual Studio 2010 (which is a bit slow, but certainly usable) then you might want to go straight to C#.
Jon Skeet
+8  A: 

If your main goal is to optimise your Excel tasks, then VBA is the language to learn.

The good thing is that if you have any programming background the learning curve is extremely straightforward.

Just run "Record Macro", perform a task, then look at the code that was generated. You've got a working example to learn from.

Andrew Shepherd
Thanks Andrew. My main "concern" is that I immediately look at things like creating structures/classes to solve some of my problems, and that then brings me to vb.net and c#. I have a beginners book in VBA but there is no reference to doing anything like that, except for using arrays. Does this require a mindset change from myside or?
NomadAlien
@nomad.alien: I don't think so. Even if you start with C mindset, you can get your things done. Maybe your code will look funny, but it's not a reason to be feel ashamed.
Tadeusz A. Kadłubowski
A: 

Microsoft plans to get rid of VBA sometime in the future. Support was already dropped from the Mac version of Office 2008 for example. It way stay around in the Windows version for some time, but no significant new development will be done on it.

Seeing you have C and Java knowledge, and considering you're starting fresh, I'd definitely go with .NET. It's simply the better investment for your time.

Like Jon Skeet says, C# (4.0) is probably your best option if you don't mind using beta software.

Thorarin
Not true. MS probably plans to get rid of many things in the future, the question is how far in the future. VBA is being reintroduced in the next Office for the Mac. VBA is an ancient technology, but it won't go away anytime soon. I don't know what the life cycle of a MS product is exactly, but I'd say 10 years. Heck, we still use Office XP at my company.
guillermooo
and we are still using Office 97! I haven't seen any real reason for upgrading more than 100 clients apart from a few.
moster67
Ouch, I pity you both :)
Thorarin
And VBA is being added back into the next version of Mac Office. VBA is in the next version of Office currently being beta tested. In my not so humble opinion "MS plans to get rid of VBA sometime in the future." is spreading FUD Fear, Uncertainty and Doubt.
Tony Toews
+1  A: 

Since you know Java & C, C# should be the easiest to learn. More jobs for C# skills too, if that's important to you.

FlappySocks
+2  A: 

If you want to dig straight into excel automation, I'd stick to VBA. If you're more interested in extending your knowledge, I'd choose one of the .NET languages, probably VB.NET.

C# seems to be more prestigious/popular, but it's also closer to what you already know. If you learn the .NET Framework using VB, that and your C/java syntax means you'll be able to read C#. It would also give a smoother transition to VBA if you change your mind.

Dave Roberts