I don't know what happening internally. I can only speculate. There can only
be a single Excel object embedding (OLE) active or visible to Excel in your
application at a time. When I say "visible to" Excel, I mean "assign to"
Excel. When a new Excel OLE is created, the reference to the previous one
from Excel is replaced and no longer there to reconnect. This is what you
start seeing strange things on the first excel ole. Based on this behaviour,
I suggest you work with this limitation instead of fighting again it. You can
still achieve what you want if you are willing to modity your design.
What you need to do is to delete the excel ole and recreate it when user
switch back from other window. It's ugly but it works. If you have a lot of
excel ole windows that need to jump back and forth, you might want to
consider other architecture options.

Signature
- jpl -
> Can you (or anyone else) explain why it won't work?
>
[quoted text clipped - 8 lines]
> >
> > Regards,
JLB - 21 Sep 2006 13:33 GMT
Thanks for your reply, jpl.
Your explanation is certainly what I have been suspecting, but what I don't
understand is that Internet Explorer does not behave in the way you and I are
seeing the WebBrowser control behave. You can open multiple excel files in
multiple IE windows and switch between them with no problems. The active IE
window seems to pull the Excel "focus" to it. You can even double-click
*.xls files and they will open in the actual Excel Application (using the
same instance as the 2 IE displayed files), another impossiblity when using
the WebBrowser ctrl. This tells me that the code under the WebBrowser
control is not exactly the same code that IE uses; it may be a part of it,
but it is not all of it.
(As a side note, WebBrowser does not have the same problem with Word files.)
As for your suggested workaround, you took the thoughts right out of my
head. I'm too pressed for time to consider a redesign, so hopefully the
users won't mind the ugliness that will ensue...
Regards.
> I don't know what happening internally. I can only speculate. There can only
> be a single Excel object embedding (OLE) active or visible to Excel in your
[quoted text clipped - 22 lines]
> > >
> > > Regards,