Skip to content

Firing an event when pasting a task – possible?

Martin HärriMember for 15 years 5 months
Created
2
3
0

  • I would like to write some VBA code which fires when a task is pasted. The reason is that users quite often create new tasks by copying existing ones, forgetting that these already contain values, e.g. baselines, notes, etc.
    The code should fire when a task is pasted and prompt the user if they want to remove the "hidden" information from the tasks.
    This means that the code should fire:
    - when a user has copied one or several tasks from the actual or a different schedule, and pastes them into the actual schedule
    It should however not fire when:
    - a new empty line is created
    - a task is just moved (drag and drop or cut and paste)

     
  • 2 replies

    Oldest first
    1. 0
      Niek Zonneveld ·

      Martin,I don't think you can

      Martin,

      I don't think you can just trigger a macro, other than by using a shortcut key (<ctrl> + <key>) or an mpp file that kicks off a macro when it opens.

      Instead of going down the macro-route it's probably better to avoid the problem.

      A way to circumvent copying 'hidden' information is to copy and paste only the cells/info you need, instead of the entire line. This works quite well except for precedence relations. If I want to reuse information from other schedules, I normally only copy the name and duration fields, just to make sure I don't introduce any other rubbish.

      H.T.H.

    2. 0
      Martin Härri ·

      Nick, yes, it is possible to

      Nick,

      yes, it is possible to trigger a macro with so-called "task events" or "resource events". They fire e.g. when a task is created, deleted, etc.

      Copying in the way that you propose does not work for my users, as I there are several 100 people using MSP, most of them only occasionally. So I cannot teach them that this tool behaves differently than Excel, which they are all familiar with. I need to find a solution to catch copy/paste via macro.

      Any other ideas? Thanks a lot!

    Log in or join to reply

    ProjectControls.com is free to join. Members can post questions, reply, vote and follow discussions.

    Existing members: your original username and password still work. Forgot password?