I'm tryin to use the FileDependencies object to get the path of various xrefs/images when these have been attached using 'no path'. However, I am encountering intermittent exceptions of the type 'The object has disconnected from its clients'.
My C# code is:
foreach(AcadFileDependency dep in Document.FileDependencies)
// Do stuff with file dependency object
The exception thrown is when the system attemtps to access the GetEnumerator method of FileDependencies during the foreach construct.
When the file is open I also tested it through the VBA editor using this code:
For Each fd In FileDependencies
This throws the "object disconnected" exception.
The strange thing is sometimes I can open the document and run it through VBA code no problem and it will also run through the C# code as well, but other times it seems to choke.
I've also tried accessing the file dependency list using an int indexer with the Item method, but this always fails with a "Key not found" exception.
This is driving me nuts. Does anybody have some ideas on what could be causing this?