Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Interop.Excel and Tools.Excel?

Tags:

c#

excel

com

I'm currently working on an AddIn for Microsoft Excel, and I'm a little confused about something :

What are the differences between Interop.Excel and Tools.Excel ? For example, between Interop.Excel.Workbook and Tools.Excel.Workbook ? Or Interop.Excel.Worksheet and Tools.Excel.Worksheet ?

What are they used for, where do I use which one ? Is it possible to cast from one to another ?

Thanks!!

like image 382
Nicolas C Avatar asked Jun 10 '13 13:06

Nicolas C


People also ask

What is Microsoft Office tools Excel?

The Microsoft. Office. Tools. Excel namespace contains a set of types that extend and support the Microsoft Office Excel object model in projects created by using the Office development tools in Visual Studio.

Is OpenXML faster than Interop?

Probably yes, but it really depends on the complexity of the sheet. It is more efficient to use OpenXML SDK then Interop, but the code is a bit more complicated. Also both OpenXML SDK and Excel Interop are third party libraries.

Does Microsoft Office Interop Excel require Excel to be installed?

Yes, you are right. You need Excel to be installed to use the Excel Manipulation feature with Microsoft. Office.


1 Answers

Microsoft.Office.Tools.Excel is the set of objects exposed by visual studio tools for office, for Excel projects. If you're doing straight Interop, using the Shared Add-in template, then you shouldn't reference this library in your project. It's only relevant if you're creating a project based on a VSTO template.

If you created the Add-in from a template labelled for Excel, under the Office folder in the New Project dialog box, then you need to leave this reference. The library comes into play, for example, when you use the Globals.ThisApplication keyword. This page will give you some explanation and links to a topic about the Tools.Excel library: http://msdn2.microsoft.com/en-us/library/wss56bz7.aspx

Source : http://social.msdn.microsoft.com/forums/en-US/vsto/thread/86a62151-fbf0-4584-a68c-83060fb95c3d

like image 176
Mez Avatar answered Sep 29 '22 14:09

Mez