Mathieu Guindon♦
Moderator
About Me
Me
is a reserved name (you can't have a variable by that name) that refers to something that can only exist at run-time in a procedure's scope: the current object. Under the hood, when you make a member call to DoSomething
against a Class1
object, the call goes essentially like this:
Set obj = New Class1
Class1.DoSomething obj
This means DoSomething
looks like this in VBA:
Public Sub DoSomething()
End Sub
But VBA sees it like this:
Public Sub DoSomething(ByVal Me As Class1)
End Sub
That makes Me
an implicit locally-scoped ByVal
parameter of type Class1
, and inside the DoSomething
scope it holds a reference to whatever object the caller is currently using.
Moderator on Code Review Stack Exchange, 2015-2018, 2019-
Microsoft MVP (Office Apps & Services), 2018-
258
answers
87
questions
~116k
people reached
-
Quebec
-
Member for 7 years, 11 months
-
889 profile views
-
Last seen Feb 15 at 14:35
Communities (41)
- Code Review♦ 73.8k 73.8k 1717 gold badges177177 silver badges447447 bronze badges
- Stack Overflow 63.5k 63.5k 88 gold badges8888 silver badges202202 bronze badges
- Meta Stack Exchange 7.6k 7.6k 22 gold badges2626 silver badges5151 bronze badges
- Software Engineering 1.6k 1.6k 1616 silver badges3030 bronze badges
- Database Administrators 874 874 22 gold badges66 silver badges1313 bronze badges
- View network profile
Top network posts
- 122 Down with FizzBuzz... LOL
- 102 Is VBA an OOP language, and does it support polymorphism?
- 61 Interview coding test: Fizz Buzz
- 54 Implementing String.Format() in VB6
- 53 Unit of Work and Repository with Entity Framework 6
- 53 Are there disadvantages in putting code into Userforms instead of modules?
- 52 Please show hats in the Android app (aka android app hates hats)
- View more network posts →
Top tags (99)
Score
2,322
Posts
307
Posts %
89
Score
284
Posts
22
Score
254
Posts
29
Badges (321)
Gold
3
Rarest
-
Sep 3 '15
-
Jan 6 '16
-
Apr 22 '14
Silver
87
Rarest
-
Jun 18 '19
-
Nov 21 '18
-
Aug 1 '16
Bronze
231
Rarest
-
Dec 17 '17
-
Aug 16 '16
-
Apr 18 '16