ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recompile com object while excel is running (https://www.excelbanter.com/excel-programming/351481-recompile-com-object-while-excel-running.html)

[email protected]

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!


RB Smissaert

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!



[email protected]

Recompile com object while excel is running
 
So is there a way to tell excel to drop the reference?


RB Smissaert

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?



[email protected]

Recompile com object while excel is running
 
thx. Will give it a try.
-ECW



All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com