David Rougier

David Rougier

  • NA
  • 8
  • 4.5k

Instanciating an interface + Excel.Application

Apr 3 2011 5:38 PM
Hi everyone,

I am going to manipulate an Excel workbook via C# programming. I looked to some information to do so. A C# statement disturbed me while reading. Here is the statement :

Excel.Application oXl = new Excel.Application;

"Excel" is an alias for a namespace. The statement disturbed me because "Application" is an interface and it does not contain any code by definition. The fact that the object library allows the programmer to "control" Excel may justify the instanciation. Could someone explain me clearly why the instanciation is possible ?

Thanks in advance. 

Answers (9)