Use InactivateTaskToggle method to inactivate tasks

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

  1. Aparna

    Aparna

    Joined:
    Jun 23, 2015
    Messages:
    1
    Likes Received:
    0
    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()
    https://msdn.microsoft.com/en-us/library/office/ff866141.aspx
    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?

    SelectAll
    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
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paolo

    Tasks calendars

    Paolo, Apr 23, 2009, in forum: Project
    Replies:
    0
    Views:
    590
    Paolo
    Apr 23, 2009
  2. Paolo

    Tasks calendars

    Paolo, Apr 28, 2009, in forum: Project
    Replies:
    0
    Views:
    205
    Paolo
    Apr 28, 2009
  3. carol
    Replies:
    0
    Views:
    413
    carol
    Apr 20, 2011
  4. JLCabrera

    Viewing Tasks Notes from PWA

    JLCabrera, Oct 27, 2011, in forum: Project
    Replies:
    0
    Views:
    410
    JLCabrera
    Oct 27, 2011
  5. Lori
    Replies:
    0
    Views:
    353
  6. Catopia
    Replies:
    0
    Views:
    613
    Catopia
    Jul 9, 2013
  7. amithrt
    Replies:
    0
    Views:
    403
    amithrt
    Nov 2, 2013
  8. Thomas Schuber

    Display Predecessor and Successor Tasks

    Thomas Schuber, Sep 2, 2014, in forum: Project
    Replies:
    0
    Views:
    451
    Thomas Schuber
    Sep 2, 2014
Loading...