VBA expression help

X

xargon

Hi everyone,

I am going crazy with a VBA problem. I want to create an expression that
will check if a shape's master property is not set to Nothing. So, I use
an expression like:

If shape.Master <> Nothing then
-- do something
End If

This fails to work! Apparantly, you cannot use Nothing in an expression.
So, how can I check for something like this in an expression? I tried Null
and that does not seem to be a substitute for Nothing :(

Thanks and cheers!
xargon
 
J

junethesecond

Please, use keyworod "is", for example,
............
Set shp = ActivePage.Shapes(1)
If Not shpe.Master Is Nothing Then
............
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top