View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default Tom Ogilvy, your code about locating a specified shape in VBA


Tushar Mehta wrote:
Set creates a reference to an object. Let, on the other hand, assigns a
value. Since Let is used far more than Set, the VBA compiler allows one
to omit it, i.e., a=b is actually
Let a=b.

For more search XL VBA help for 'set statement'.

--
Regards,

Tushar Mehta


This is tangential to the OP, but this aspect of VBA has always annoyed
me. I don't see why the compiler/interpreter can't handle this
automatically. Since something like "myShape = Shapes(1)" is *always* a
syntax error, there would be no possible ambiguity in letting the
compiler convert it implicitly into a Set. I always thought that the
point of VBA is to allow you to write straightforward code in a rich
object-universe while letting the compiler handle the background
pointers and memory management. I'm not sure why the designers of VBA
allowed pointers to peak through here. Things like shape variables that
are transparent to the user would be quite nice. What am I missing?

-John Coleman