¿Cuál es la diferencia entre Microsoft.Excel.Office.Core y Microsoft.Office.Interop.Excel?

I have to read into creating Add-Ins for Excel and alike and am starting to wonder what the difference between the two namespaces are?

At every tutorial I read, Interop is being used. But in the books, they mostly use Office -- why are there two namespaces, containing more or less the exact same classes, yet are different from each other?

Is there any reference that makes this easy to understand?

preguntado el 01 de febrero de 12 a las 14:02

2 Respuestas

pensé Office is the official PIAs as shipped by Microsoft but I just downloaded the 2010 ones now to check and that was not the case

There are no PIAs available for Office 2000, just from Office XP onwards, but I can't see any reference in the docs to the kind of namespaces that you're talking about.

Are you sure it's not just a namespace alias that someone has set up viz.

using Microsoft.Excel.Office = Microsoft.Excel.Interop;

although quite why anyone would do that is beyond me!

EDITAR I just created a skeleton Excel addin in VS2010 and it has the following aliases:

using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;

Does that explain what you're seeing?

Respondido 01 Feb 12, 18:02

Yes, I saw that now - But still, what are the differences between the two? - FP

None, as far as I can see. A using statement used in that fashion just provides a convenient shorthand for referring to members of that class. When you say they're 'different from one another' what precisamente do you mean? Can you give some specific examples? - mediodía y

Based on my own experience, Microsoft.Office.Interop.Excel contains all the Excel objects and methods, such as Workbook, Excel Addins and Application.WorksheetFunction. Microsoft.Office.Core contains those that apply across Office, such as CommandBarButtons, FileDialogs and COM Addins. All of the Mso variables, such as MsoAlertType and MsoColorType are in the latter as well.

I've never seen Microsoft.Excel.Office.Core, referred to in your question title.

Respondido 01 Feb 12, 20:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.