Every time I see an example of office automation using .NET, the language used is VB.NET.
This is because initially automation of Office applications, such as Excel, could only be performed using VB Script in a macro, and the same people who wrote these macros naturally tend to gravitate to VB.NET or there is a reason not to use C # to automate Office?
It seems I can create an instance of an Excel class from C # the way I would use CreateObject from VB.NET.
excel = Type.GetTypeFromProgID("Excel.Application");
If you needed to write a .NET program using Excel Automation, what language would you use and are there any reasons to avoid C #, except maybe there are examples of VB.NET ores?
Edit:
I was thinking of writing code with an explicit link to the Microsoft Excel object library and explicitly instantiating an application object of the Excel class, and then, after the program was mostly tested, changing the code to use late binding to allow the application to run with different versions of Excel.
Will the code be radically different?
For example, using early binding, I can do this ...
var excel2 = new Microsoft.Office.Interop.Excel.Application(); excel2.Visible = true;
Lately, will I be forced to use radically different code like this?
excel = Type.GetTypeFromProgID("Excel.Application"); excel.InvokeMember("Visible", BindingFlags.SetProperty, null, excelObject, parameter);