Muokkaa

Jaa


Procedure declaration does not match description of event or procedure having same name

Your class module has a procedure name that conflicts with the name of an event. This error has the following cause and solution:

  • A procedure has the same name as an event, but does not have the same signature (that is, the number and types of the parameters). This can occur if you do something such as add a new parameter to an event procedure. For example, if you modify the definition of a form's Form_Load event procedure as follows, this error will occur:

      Sub Form_Load (MyParam As Integer) 
      . . . 
      End Sub
    

    If the procedure isn't the event procedure corresponding to the event, change its name. If the procedure corresponds to the event, make the parameter list agree with that required by the event (if any).

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.