DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Exclamation Releasing .NET Automation Addins for MS Excel

    Hi,

    I have a question about .NET automation addins for MC Office and Excel in particular. I have created a C# automation addin for Excel by using a COM interop wrapper - along the lines of:

    http://blogs.msdn.com/eric_carter/ar...01/273127.aspx

    The addin works great. However, my problem appears when I try to release the add-in. In the past I've used XLLs and was able to load and release the addin on the fly by simply unchecking the addin from the tools>add-ins menu. this is really handy when you need to recompile. Unfortunately I don't seem to be able to achieve the same behaviour for my automation addin. Does anyone know how to release/unload?

    Any help much appreciated !! Thanks

  2. #2
    Join Date
    Feb 2006
    Posts
    3
    i'm still struggling with this - please please someone help me

  3. #3
    Join Date
    Feb 2004
    Posts
    27
    Try the following:
    Include the Excel COM object into your project.
    In code:
    //Initialize Excel
    Excel._Application App;
    App = (Excel._Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Applicat ion");
    //do your work
    ....
    //To release Excel
    int z;
    do
    {
    z = System.Runtime.InteropServices.Marshal.ReleaseComObject(App);
    }
    while (z != 0);
    App = null;

Similar Threads

  1. Replies: 0
    Last Post: 12-26-2005, 08:43 AM
  2. Excel Object not releasing
    By Hariharan in forum .NET
    Replies: 1
    Last Post: 07-05-2005, 08:12 AM
  3. I'm confused !!!
    By cgts in forum .NET
    Replies: 24
    Last Post: 02-28-2003, 03:43 PM
  4. C# & .NET
    By Vikas Garg in forum Careers
    Replies: 18
    Last Post: 07-13-2002, 11:58 AM
  5. Replies: 0
    Last Post: 03-20-2002, 05:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links