Dear all,
Excel 2007 and VBA are currently driving me mad. I am trying to remove broken references from an Excel 2007 VBA project from within VBA. Excel is patched with all available updates from Microsoft, and I don't use any third-party plugins (Add-Ins) or other extensions. My O/S is Windows 7 Pro x64.
I have found the following article which explains how to remove (or fix) broken references from within VBA:http://support.microsoft.com/kb/308340/en-us
My problem: As soon as the .IsBroken method is called, I am getting a runtime error (trying to translate from German language: "The method 'IsBroken' of the object 'Reference' has failed"; the error number is 0x8002801d).
The same runtime error occurs if I try to read other properties of the reference object in question. Weirdly enough, a few of these properties do not cause an error (e.g. Major and Minor).
Even worse, I can't remove the broken reference from the references collection. If I try that (by using the References.Remove method) I get a runtime error with the same number, but the error message is different (what has been going on there?): "Object library is not registered" (again having tried to translate from German).
What else could I do now? I think the problem with .IsBroken could be solved by catching the error by using "On Error Goto ...", but this won't solve the whole problem since I then still can't actually remove the broken reference.
By the way, I wouldn't have needed the article I have mentioned above since this article describes exactly the way which is the most straightforward and logic one and since I already had done it that way. But because it didn't work, I began searching, came across this article, copied the code and put it into my Excel VBA project without any alteration (except replacing ActiveDocument by ActiveWorkbook since the former one doesn't seem to be known by Excel 2007) - and got the very same problem.
Any ideas?
Thank you very much,
Binarus