currently I have the misfortune to write C# code to read stuff from an Excel file. I'm using the Nuget Excel Interop to accomplish this.
I try to follow the advices given in this great blog post here: https://www.add-in-express.com/creating-addins-blog/2013/11/05/release-excel-com-objects/
But even when putting everything into a variable that gets released in the end, when I start accessing cells (type Range
), the Excel process just wont die.
Hence my question: When I do this:
Application excel = new Application();
_toBeReleased.Add(excel);
DoStuff(excel);
...
void DoStuff(Application excel2)
{
...
Does excel2
also need to be released? Because the reference was given byval
into the method?