View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Empty keyword in statment Application.caption?

Or declaring it as a variant would achieve the same.

As Dave said, it is highlighted in Blue, so I guess VBA does see it as a
keyword, but it seems of limited utility except for "documentation".

--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
Since you're not using Option Explicit, VBA creates a new variant
variable called HorseRadish of subtype, yes, Empty (VarType() =
vbEmpty =0).


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Tom Ogilvy" wrote in message
...
substitute Horseradish for empty and see if you don't get the

same result.

Sub Tester2()
Dim V As Variant
Debug.Print V = HorseRadish
V = 123
Debug.Print V = HorseRadish
V = HorseRadish
Debug.Print V = HorseRadish
End Sub

gives the same result for me.

If you have a reference, please post it.

--
Regards,
Tom Ogilvy

"Chip Pearson" wrote in message
...
Empty is a keyword indicating that a Variant type variable

has no
contents. E.g.,

Dim V As Variant
Debug.Print V = Empty
V = 123
Debug.Print V = Empty
V = Empty
Debug.Print V = Empty


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tom Ogilvy" wrote in message
...
Personally, I have found little in the help to indicate

that
"empty" is a
key word.

If empty isn't declared as a variable or is declared as

Variant
and never
initialized, then it would represent the value of an
uninitialized variable.
Used in the context you show, it would be equivalent to a

null
string, so it
does nothing that I can see.

--
Regards,
Tom Ogilvy


"Mel" wrote in

message
...
I was trying to learn from some code someone else had
written. What is the keyword Empty used for in the
statement below. If I remove the "Empty &" the results
seem to be the same. Is it just a placeholder of some
kind?


Application.Caption = empty & "Microsoft Excel (Alarm Set
for "

Application.Caption = "Microsoft Excel (Alarm Set for "