Can't call Friend procedure on an object that isn't an instance of the defining class (Error 97)
A Friend procedure is callable from a module that is outside the class, but part of the project within which the class is defined. This error has the following causes and solutions:
You tried to call the Friend procedure of a class. Although your reference variable is of the proper type, the variable points to an instance that isn't an instance of the class. For example, this can occur if there are two classes, class ics and class y (that implements class y ), but you mistakenly assign the instance of classy to the instance of class ics.
You tried to access a Friend property or method either cross-process or cross-thread. Friend procedures are not part of a class's public interface, so they cannot be marshaled cross-process or cross-thread.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.