Use InactivateTaskToggle method to inactivate tasks

Discussion in 'Project' started by Aparna, Jun 23, 2015.

  1. Aparna


    Jun 23, 2015
    Likes Received:
    Hi All

    I am trying to write a macro that will inactivate certain task based on a criteria.
    I saw that there is a method to inactivate the task using InactivateTaskToggle()
    This is the code I am using. However, even though I am inactivating only those task that fit the condition, the result is that all tasks are inactivated. What am I doing wrong?

    Set ts = ActiveSelection.Tasks
    For Lrow = LastTSkID To FirstTkID Step -1
    Set t = ts(Lrow)
    If Not t Is Nothing Then
    If InStr(UCase(t.Text4), UCase(strType)) = 0 Then
    t.Application.InactivateTaskToggle (False)
    End If
    End If
    Next Lrow
    Aparna, Jun 23, 2015
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.