what I can do about this thanks

J

Joy

If (Len(Trim(proj.Tasks(i).Text24)) > 0) Then
...

Else

...
End If

but error: object variable or with block variable not set

if I change it to :


If Not proj.task(i).Text24 Is Nothing Then
...

Else

...
End If

error: Object does not support this property or method ...

what I can do about this

thanks
 
J

John

Joy said:
If (Len(Trim(proj.Tasks(i).Text24)) > 0) Then
...

Else

...
End If

but error: object variable or with block variable not set

if I change it to :


If Not proj.task(i).Text24 Is Nothing Then
...

Else

...
End If

error: Object does not support this property or method ...

what I can do about this

thanks

Joy,
OK, what are you defining as "proj"? The error message is telling you
that it doesn't know the meaning of "proj".

I assume you have some type of index loop for the "i" variable. Given
that, the following should work.
If Len(Trim(ActiveProject.Tasks(i).Text24) > 0 Then
...

Hope this helps.
John
Project MVP
 
J

Jack Dahlgren MVP

Are you sure Tasks(i) always refers to a real task? You should check for
blank lines in the project.

if not proj.task(i) is nothing then
if not proj.task(i).text24 = "" 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