I can access an instance of Excel in memory using Marshal.GetActiveObject. But this always returns the oldest existing instance.
I would like to iterate though all instances and be able to choose the one to link to.
Can anyone help with this please.
Try this.
Edit: There is an article that fully implements this at http://blogs.officezealot.com/whitechapel/archive/2005/04/10/4514.aspx. GetActiveObject will always return the first object from the table. This is because Office doesn't register new objects. You have to get the application from the child windows.
Edit: This is the code that worked for me.