views:

60

answers:

2

I would like to use C# for an application I'm building, but the application makes heavy use of automation (i.e. Excel, Word).

Is it feasible to use C# for such an application? It used to be a nightmare to use C type languages for things like parameter lists with null arguments etc..

What are some tips to make things easier or should I just stick with VB.NET?

A: 

Wait for C# 4, which supports optional parameters and implicit ref arguments.
It will make your life much easier.

Whether you use C# 4 or C# 3, you should use the Office Interop Extensions from the VSTO Power Tools; they will make your life even easier.

SLaks
The typo makes this a bit unreadable. "Wait for C# for"?? I think you mean "C# foUr"
MarkJ
@MarkJ: I can't believe I wrote that... Fixed; thanks.
SLaks
+1  A: 

It depends on what version of the language you're using. In .Net 4, C# supports named parameters (optional parameters). VB.Net has always had this. If you're not using .Net 4, I'd recommend using VB.Net for the interop bit - see this post from Scott Hanselman for an example.

Graham Clark
This is a compiler feature. If you use the C# 4.0 compiler you can use optional parameters even in .Net 2.0 code.
Matthew Whited