c# - Excel Interop: Quitting the Excel application instance makes my tests fail? -


i want encapsulate use of excel interop make easier use somehow in reuseable library.

so far, have written tests work altogether, except between each test, force excel quite have handle on test file no more in order able delete.

once quit application instance between after each of tests, excel seems no longer responding, causing windows display

"excel has stopped working , looking solution"

message. message lasts few seconds, meanwhile excel closing, causing hang on file occur , tests throw exception

"cannot access file because being used process..."

message. otherwise, each of tests run individually fine!

any clue on how solve issue?

do overuse applicationclass.quit() method?

quitting excel once testing through tests causes files created tests purpose not deleteable.

thanks! =)

if you've made changes workbook "do wish save changes?" dialog holding things up. try setting _workbook.saved property true prior quitting application. see here details


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -