raymond said:
Help,
A macro I had been using in Word 2002 is now giving me an error
message : "The requested member of the collection does not exist."
I hope I don't have to re-create this macro...
Any one...?
Thanks!
Hi Raymond,
What you've posted isn't quite enough information to be able to help. When
the error occurs, there should be two buttons in the message box, Debug and
Cancel. Click the Debug button, which opens the macro editor. The line where
the error occurred should be highlighted. Paste that line into a reply
message, so we can see which collection the message is talking about.
This sort of error often has more to do with what's in the current document
than with how the macro is constructed. For example, if the macro expects to
work with a table, it may contain a reference to ActiveDocument.Tables(1).
But if the document doesn't contain any tables, that reference will cause
the "does not exist" error message.
A properly written macro should test the document to make sure all the
expected bits are there, and either compensate or quit if they aren't. At
worst your macro needs to have such tests added to the existing code.