This project has moved and is read-only. For the latest updates, please go here.

Excel Properties Dialog won't close after closing/disposing worksheet/workbook

Jan 4, 2012 at 10:19 AM

I am using NetOffice to open and edit Excel Workbooks. To open workbooks faster, an Excel Application Object is cached and will be reused later.

Instead of disposing the whole application, only the workbook and worksheets are closed/disposed. This works really well except for some Property Dialogs that won't close after disposing, e.g. the property Dialog that opens if you double click a diagramm inside an excel sheet.

My Dispose Method looks like this:


I also tried to close and dispose Dialogs collections. 

Am I doing something wrong here?



Jan 4, 2012 at 12:42 PM
Edited Jan 4, 2012 at 12:42 PM


Hello Apu,

1.) its not necessary to use Dispose(true); you can use Dispose(); the method calls Dispose(true) internaly.

2.) i think you have misunderstood the concept of COM proxy management in NetOffice a little little bit.

whats wrong here? the first call is okay. the second call is not necessary because the third call dispose also child instances.
but another mistake is occured here. with any call of m_Application.Workbooks you create a new COM proxy in other words what does
this code line?


Nothing! you create a workbooks proxy and dispose them immediately. proxy the management is bind to spezific proxies
if you have 2 workbooks collection proxies and create 3 workbooks with first collection proxy and dipose the second collection proxy,
nothing happens with the 3 workbooks. but if you use application.DisposeChildInstances() all proxies are dispose because application is ouer root object.

you can shrink your 8 codelines to


NetOffice allows you to observe the count open COM proxies in your application.

 int proxyCount = LateBindingApi.Core.Factory.ProxyCount;

a little bit documentation about COM proxy management in NetOffice.
Jan 4, 2012 at 2:20 PM

Thx very much for the quick answer. Gonna try it when I get back and will post results.