Table of contents
TOC
Collapse the table of content
Expand the table of content

Invalid use of Me keyword

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

The Mekeyword can appear inclass modules. This error has the following causes and solutions:

  • The Me keyword appeared in astandard module.

    The Me keyword can't appear in a standard module because a standard module doesn't represent an object. If you copied the code in question from a class module, you have to replace the Me keyword with the specific object or form name to preserve the original reference.

  • The Me keyword appeared on the left side of a Set assignment, for example:

Set Me = MyObject    ' Causes "Invalid use of Me keyword" message. 
Remove the  **Set** assignment.

 **Note**   The **Me** keyword can appear on the left side of a **Let** assignment, in which case the default[property](vbe-glossary.md) of the object represented by **Me** is set. For example:
Let Me = MyObject    ' Valid assignment with explicit Let. 
Me = MyObject    ' Valid assignment with implicit Let. 

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

© 2018 Microsoft