Yet another reason why C# is LAME

From an email list, a poster finally got some code to show an excel dialog to work. This is their code:

 


if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing)

 

In VB, that code is:

If xlApp.Dialogs(Excel.XlBuiltInDialog.xlDialogOpen).Show(sTextName) Then

 

C# sure does suck when it comes to working with Office or COM.

 

 



1 Comment so far

  1.   Jason Bock on March 29th, 2006          

    Then use VB when interacting with crappy COM servers that require this kind of “interaction”.

    Move along, nothing to see here…