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!!
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.
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.
Yes, you are right. You need Excel to be installed to use the Excel Manipulation feature with Microsoft. Office.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With