Click here to Skip to main content
15,881,812 members
Articles / Desktop Programming / XAML

Silverlight 4: Interoperability with Excel using the COM Object

Rate me:
Please Sign up or sign in to vote.
5.00/5 (22 votes)
31 May 2010CPOL7 min read 194.9K   61  
Silverlight 4 has the feature to talk with Excel or any other application using the COM API. In this article, I will guide you to understand this feature step-by-step.
  • Silverlight4_Interoperability_ExcelApp_Demo.zip
    • Silverlight4 Interoperability ExcelApp Demo
      • Silverlight4 Interoperability ExcelApp Demo.sln
      • Silverlight4 Interoperability ExcelApp Demo.suo
      • Silverlight4.Interop.Excel.Demo.Web
      • Silverlight4.Interop.Excel.Demo
        • App.xaml
        • App.xaml.cs
        • Bin
          • Debug
            • AppManifest.xaml
            • ar
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • bg
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • ca
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • cs
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • da
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • de
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • el
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • es
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • et
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • eu
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • fi
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • fr
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • he
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • hr
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • hu
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • id
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • it
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • ja
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • ko
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • lt
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • lv
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • Microsoft.CSharp.dll
            • Microsoft.CSharp.xml
            • ms
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • nl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • no
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • pl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • pt
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • pt-BR
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • ro
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • ru
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • Silverlight4.Interop.Excel.Demo.dll
            • Silverlight4.Interop.Excel.Demo.xap
            • Silverlight4.Interop.Excel.DemoTestPage.html
            • sk
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • sl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • sr-Cyrl-CS
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • sr-Latn-CS
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • sv
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • System.ComponentModel.DataAnnotations.dll
            • System.ComponentModel.DataAnnotations.xml
            • System.Windows.Controls.Data.dll
            • System.Windows.Controls.Data.Input.dll
            • System.Windows.Controls.Data.Input.xml
            • System.Windows.Controls.Data.xml
            • System.Windows.Data.dll
            • System.Windows.Data.xml
            • th
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • tr
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • uk
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • vi
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
            • zh-Hans
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
            • zh-Hant
              • Microsoft.CSharp.resources.dll
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Data.resources.dll
              • System.Windows.Data.resources.dll
        • Customer.cs
        • CustomerDataProvider.cs
        • MainPage.xaml
        • MainPage.xaml.cs
        • Properties
        • Silverlight4.Interop.Excel.Demo.csproj
        • Silverlight4.Interop.Excel.Demo.csproj.user
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Silverlight4.Interop.Excel.Demo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Kunal-PC-Home")]
[assembly: AssemblyProduct("Silverlight4.Interop.Excel.Demo")]
[assembly: AssemblyCopyright("Copyright © Kunal-PC-Home 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("996a6f0d-b52f-4946-9756-e419ceec3b02")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India

Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog (www.kunal-chowdhury.com) and CodeProject.


Books authored:


Connect with Kunal on:





Comments and Discussions