Sub, Function, or Property not defined (Error 35)
A Sub, Function, or Property procedure must be defined to be called. This error has the following causes and solutions:
You misspelled the name of your procedure.
Check the spelling and correct it.
You tried to call a procedure from another project without explicitly adding a reference to that project in the References dialog box.
To add a reference
Display the References dialog box.
Find the name of the project containing the procedure you want to call. If the project name doesn't appear in the References dialog box, click the Browse button to search for it.
Click the check box to the left of the project name.
Click OK.
The specified procedure isn't visible to the calling procedure. Procedures declared Private in one module can't be called from procedures outside the module. If Option Private Module is in effect, procedures in the module aren't available to other projects. Search to locate the procedure.
You declared a Windows dynamic-link library (DLL) routine or Macintosh code-resource routine, but the routine isn't in the specified library or code resource.
Check the ordinal (if you used one) or the name of the routine. Make sure your version of the DLL or Macintosh code-resource is the correct one. The routine may only exist in later versions of the DLL or Macintosh code-resource. If the directory containing the wrong version precedes the directory containing the correct one in your path, the wrong DLL or Macintosh code-resource is accessed. You gave the right DLL name or Macintosh code-resource, but it isn't the version that contains the specified function.
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.