Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Recompile com object while excel is running

I'm very new to this so please bear with me. I have created a c# class
wich is a COM object. I call methods of that object from VBA in excel.
It all works well. great. However, sometimes I want to make changes to
the class in C#. I find that I can't recompile the class in the visual
studio .net compiler becuase it says that the files are in use. In
order to compile I need to totaly shut down excel. Is there anyway I
can compile without shutting down excel? The macro is finished, why
does it still hold on to the dll?

On a possibly related note. The c# class makes a soap call to another
server (which is single threaded). The C# object is holding the
connection to the soap server and is blocking other requests. The
connection is not closed until Excel quits.

Please Help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Recompile com object while excel is running

On the first one:
As long as Excel holds a reference to the dll you can't compile.
No idea about the second question.

RBS

wrote in message
oups.com...
I'm very new to this so please bear with me. I have created a c# class
wich is a COM object. I call methods of that object from VBA in excel.
It all works well. great. However, sometimes I want to make changes to
the class in C#. I find that I can't recompile the class in the visual
studio .net compiler becuase it says that the files are in use. In
order to compile I need to totaly shut down excel. Is there anyway I
can compile without shutting down excel? The macro is finished, why
does it still hold on to the dll?

On a possibly related note. The c# class makes a soap call to another
server (which is single threaded). The C# object is holding the
connection to the soap server and is blocking other requests. The
connection is not closed until Excel quits.

Please Help!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Recompile com object while excel is running

So is there a way to tell excel to drop the reference?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Recompile com object while excel is running

This is code that is run from within VBA in an .xla add-in:

Sub RemoveReference(strReference As String)

Dim r As Reference

For Each r In ThisWorkbook.VBProject.References
If r.Name = strReference Then
ThisWorkbook.VBProject.References.Remove r
Exit Sub
End If
Next

End Sub

It will need some alterations if you want to run this from your C# IDE,
but this is the principle of it.


RBS



wrote in message
oups.com...
So is there a way to tell excel to drop the reference?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Recompile com object while excel is running

thx. Will give it a try.
-ECW

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
More then 1 Excel object running at same time , how can I refer to right one in code? Dave Lauberts Excel Programming 5 October 28th 04 03:57 PM
Running Macro from objApp Application object Lance Hoffmeyer Excel Programming 1 August 27th 04 07:12 PM
Reference to DLL corrupts on recompile of dll Robin Hammond[_2_] Excel Programming 2 April 12th 04 08:49 AM
Excel Object in VB when running under scheduler control Peter Hoyler Excel Programming 2 December 17th 03 12:54 PM


All times are GMT +1. The time now is 07:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"