9
Answers

Instanciating an interface + Excel.Application

Ask a question
David Rougier

David Rougier

13y
2.2k
1
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)