OLE server connection loss with Excel.chart

S

Simon H

I have written an add-in that dynamically populates and displays charts from
an external data source whilst the slide show is running. It uses an
Excel.Chart as an embedded OLE object and all works fine for one run of the
slide show, The charts appear, data is correct, but for any subsequent runs
it throws a CO_E_OBJNOTCONNECTED error. If I restart Powerpoint the problem
clears until I run the slide show a second time.

Whilst debugging I have also noticed that Excel.exe appears in the process
list on first connection to the charts (which is what I would expect as I am
connecting to the OLE server) but does not close when the slide show has
ended, but waits until Powerpoint itself is closed. Killing Excel.exe does
not fix the problem - powerpoint still has to be restarted.

I'm pretty certain that this is due to reference counting on the Excel OLE
server, because I think that Powerpoint runs a slide show and when it
finishes the show ittidies up, possibly a bit too enthusiastically. Hence the
OLE server remains active and but the connection has become invalid.

Anyone have any ideas for a work-around/fix?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top