Expected variable or procedure, not module

This page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010.

There is no variable or procedure by this name in the current scope, but there is a module by this name. This error has the following cause and solution:

  • The name of a module is used as a variable or procedure. Check the spelling of the variable or procedure name, and make sure the name you want to refer to isn't private to another module. A module name can be a qualifier, but can't stand alone.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).