View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lvcha.gouqizi lvcha.gouqizi is offline
external usenet poster
 
Posts: 38
Default How to judge wheter an object is existing or not

I have a function which basically returns a found shape if succeed. But
what if nothing could be found and nothing is returned? How to judge
this in its calling code?

Function findShape(text as String)

if *** then
findShape = specifiedShape
end if
end function



sub doSth()
if findShape("special") then
msgbox "found"
end if
end sub

There always reports error on the line "if NOT findShape then", saying
that "Object does not support this property or method". Any
suggestions? Thanks,

lvcha