• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Comparing objects in if statement

Hi

I have this problem
ActiveProject.Tasks(i).Name when I reach this poing the object is not initialized. But what every I try with I get an exception

if ActiveProject.Tasks(i).Name > ""
if ActiveProject.Tasks(i).Name is nothing = false

etc.etc. all fails

But I guess this is easy :)
/Joachim
0
joachimc
Asked:
joachimc
1 Solution
 
TimCotteeHead of Software ServicesCommented:
Use:

If Not (ActiveProject.Tasks(i) Is Nothing) Then

You need to refer to the object, not a property thereof.
0
 
joachimcAuthor Commented:
aha I missed the perentecis.
/Joachim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now