Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What Is "Me." in Visual Basic Coding?
In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the symbol "Me.". Examples: Me.Activate Me.Saved = True These were used in discussions of event programs, if that's any help. I checked, and they aren't defined variables or arguments. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What Is "Me." in Visual Basic Coding?
The 'Me' keyword always refers to the instance of the class in
which it is contains. For example, if it appears in the ThisWorkbook module, it refers to ThisWorkbook. If it appears in Class1, it refers to the instance of Class1 when the line of code is executed. 'Me' is only valid in class modules (including userforms, classes, ThisWorkbook and the Sheet code modules). It is not valid in a standard module. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "SidBord" wrote in message ... In reading some examples written in J. Walkenbach's Visual Basic Programming book, I noticed he now and then uses the symbol "Me.". Examples: Me.Activate Me.Saved = True These were used in discussions of event programs, if that's any help. I checked, and they aren't defined variables or arguments. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What Is "Me." in Visual Basic Coding?
me is used in object modules to refer to the current instance of the
object (or class) examples of object modules: userforms = me rfers to the running form modules for worksheets = me refers to the sheet thisworkbook = me refers to the workbook in which the code resides you cannot use it in 'normal modules' keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "SidBord" wrote: In reading some examples written in J. Walkenbach's Visual Basic Programming book, I noticed he now and then uses the symbol "Me.". Examples: Me.Activate Me.Saved = True These were used in discussions of event programs, if that's any help. I checked, and they aren't defined variables or arguments. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
What Is "Me." in Visual Basic Coding?
Me stands for the current control, this way you don't have to retype the
current control's name over and over. for example if a button control needs to change its own label then you can just do this: Me.Label = 'New Name' "SidBord" wrote in message ... In reading some examples written in J. Walkenbach's Visual Basic Programming book, I noticed he now and then uses the symbol "Me.". Examples: Me.Activate Me.Saved = True These were used in discussions of event programs, if that's any help. I checked, and they aren't defined variables or arguments. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
What Is "Me." in Visual Basic Coding?
Thanx, guys. That clears that up.
-----Original Message----- me is used in object modules to refer to the current instance of the object (or class) examples of object modules: userforms = me rfers to the running form modules for worksheets = me refers to the sheet thisworkbook = me refers to the workbook in which the code resides you cannot use it in 'normal modules' keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "SidBord" wrote: In reading some examples written in J. Walkenbach's Visual Basic Programming book, I noticed he now and then uses the symbol "Me.". Examples: Me.Activate Me.Saved = True These were used in discussions of event programs, if that's any help. I checked, and they aren't defined variables or arguments. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic "Blinking" Cursor??? | Excel Discussion (Misc queries) | |||
Excel crashes on "Close" Visual Basic error 400 | Excel Discussion (Misc queries) | |||
"Microsoft Visual Basic runtime error '424' object required". | Excel Worksheet Functions | |||
Registry key for "Trust access to Visual Basic project" | Excel Programming | |||
How to set equivalent of Visual Basic "redraw = false" | Excel Programming |