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
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?
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.