PRB: Controls and Macros Cannot Have the Same Name in VBA (244514)



The information in this article applies to:

  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 6.0
  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 6.1

This article was previously published under Q244514

SYMPTOMS

If a Visual Basic for Applications (VBA) project has a control and a macro with the same name, and the user tries to run the macro using the Macro's Dialog, an unspecified error might result and the file containing the project might be corrupted.

CAUSE

This problem occurs because VBA cannot differentiate between the macro and the control. This results in a error message and unpredictable behavior.

RESOLUTION

Macros and controls must not have the same name in a VBA project.

Modification Type:MajorLast Reviewed:11/19/1999
Keywords:kbprb KB244514