What are some resources that will help get me up and running quickly with the Excel interop in C#?
|
Here's a decent article with some useful examples. |
||||
|
You can learn a lot by recording a macro (in Excel) and analyzing what has happened. My primary programming language is C#, but for my communiction to Excel (or other Office/COM objects) I always use VB.Net. This makes it easier to transfer from VBA (recorded) to .Net. VB.Net makes its easier to work with late binding. First I use early binding (gets me the Intellisense), afterwards I change my types to Object, so I don't depend on the specific version of Office anymore. |
|||
|
The article Understanding the Excel Object Model from a Visual Studio 2005 Developer's Perspective by Ken Getz covers the Excel object model in detail. Code examples are in both VB.NET and C#. Some important caveats are covered in C# and VBA: Like Oil and Water, also by Ken Getz. I would also see the article: How to build an Office COM add-in by using Visual C# .NET. HTH... |
||||
|
If you are looking to learn Excel Object Model, the VBA help is pretty good. You might use "Primary Interop Assemblies" to work with Excel |
||||
|
1) First thing first; Download the Office Interop Assemblies from which you will access all of the objects, properties and methods in Excel interop and the appropriate references to your project. BE AWARE: Any machine that you intend to run your code on will need these assemblies installed also. You can either include them in your install package, or they come with .NET framework 1.1, so if your clients have that installed, they will probably have the interop assemblies.
I hope that helps. |
|||
|
MSDN has a wealth of information... http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx |
||||
|
MSDN is always worth a read. |
|||
|