References.Remove References(1) DOES NOT WORK for "MISSING:" Refs

References.Remove References(1) DOES NOT WORK for "MISSING:" Refs

Post by jcarpe » Sat, 29 May 2004 00:22:19


Before I begin let me say that I have already tried the usual pat
answer I find on these groups. It does not work. So please give me
something I can use. And I am perfectly aware of the virtues of "late
binding" vs. "early". It is in fact why I need to remove these missing
references via code (dont ask me to do it manually).

Pat answer:

Cycle through the References collection for the VBProject and use the
IsBroken property to locate the missing reference and then use the
Remove method to remove it.

Wakeup Call:

IT DOES NOT WORK. IsBroken is a method of the object. If you cannot
load the object, you cannot use the method. Thus you get "Runtime
Error 48" "Error in loading DLL". Even if I trap for the error, I
cannot get the Remove method to work. It acts like it is working but
the "MISSING:" reference remains.

Bringing it Home:

Thanks to a bug in the MSOffice 2002 (XP) when users open up an excel
document developed in XP and then reopen it in Office 2003, all the
version specific references are converted from 10.0 to 11.0. This is
great for Windows 2003. However try to do the same in reverse. I mean
open up the document saved under 2003 in MSOffice 2002. All the
references in the code revert back to 10.0. ALL EXCEPT FOR "Microsoft
Word 11.0 Object Library". It remains marked "MISSING:". Worse yet the
Word 10.0 Object Lib is not checked breaking our code.

Frustrated (a bit),

Jamie