سؤال

I have created a C# DLL to be used from Excel VBA. I compiled the DLL on my dev machine, and I have moved the DLL and the TLB files onto a development server.

I used RegAsm to register the DLL, this worked fine. I then opened VBA and added a reference to the .TLB file. I then used the class within VBA and all worked fine.

I have now made a change to the c# class library, compiled the library, but when I try and overwrite the filed on the development server, they are locked as being used by another process.

I attempted to use RegAsm /unregister, and this still didn't help out.

Thanks in advance.

هل كانت مفيدة؟

المحلول

make sure you have closed all instances of Excel as they will be locking the addin. Also you might have some ghost Excel processes in task manager which you can kill. The below is a batch script which will kill all instances of Excel:

taskkill /F /IM EXCEL.EXE
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top