I’m working with VSTO and the Interop Namespaces for a while now. For the most of its parts it is good (enough). But sometimes it seams realy ridiculous.
There are methods which return an object which has to be casted when it’s obvious what they should return.
Like this example to add a new worksheet:
sheet = (Excel.Worksheet)application.ActiveWorkbook.Worksheets.Add(missing, application.ActiveWorkbook.ActiveSheet, 1, missing);
Other times you need to use the missing Type for method calls because there isn’t a method overwrite for it. (I know that’s just a problem in C# and not in VB)
Like in this example to protect a excel sheet:
sheet.Protect(missing, true, true, true, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing);
My question is now:
Is there any kind of wrapper, framework, api, … to avoid all these little inconveniences? (Or any kind of framework which offers a few more convenient methods)
You should use the VSTO Power Tools extension libraries. Download VSTO_PTExtLibs.exe from MSDN. They provide extension methods for making interop with the Office API simpler.