Forum Discussion
Hammock Tasks and VBA
- Jun 10, 2021
First of all I should note that Paste Links are prone to corruption. They use dated DDE protocol for OLE links that I found to be "shakey" under older versions of Project and as I noted, doesn't appear to work correctly under Windows 10 (at least for me), although it may work under Windows 10 if applications are set to run as admin.
Using Application.ObjectLinks will open the Edit Links window and that will show all the OLE links in the current file. Unfortunately the link data presented is not very useful (i.e. only gives the project name and a link number). The "source" task can be identified by selecting a link and using the Open Source button but there is no "destination" info that identifies which task is the destination. You might be interested in reading this Wiki article:
https://social.technet.microsoft.com/wiki/contents/articles/32040.ms-project-hammock-tasks.aspx
John
As far as detecting which tasks are hammock tasks, the best you can do is to query the EditLinks window using the Application.ObjectLinks Method. If there are any paste links present in the file, the window will open, otherwise you will get an error which you can trap. As noted, the ObjectLInks Method is at application level and not available at task level.
Interestingly I cannot get hammock tasks to work with Project 2019. A hammock task can be created and the first time it will "hammock" as desired, but it will not update when the source or destination fields are changed, either directly in the view (i.e. manual update of Start and/or Finish fields) or via the EditLinks window. It works fine in Project 2010 and earlier.
Hope this helps.
John
Thank you for taking the time to respond.
On creating the tasks I will just have to live with the copy/paste method - c’est la vie
I have had a quick play with the Application.ObjectLinks method.
So this gives me a binary yes/no on whether links exist, so there is no way to query the links themselves to find to/from data?
I was hoping to find a way of identifying which specific tasks were the hammock tasks ![]()
- John-projectJun 10, 2021Silver Contributor
First of all I should note that Paste Links are prone to corruption. They use dated DDE protocol for OLE links that I found to be "shakey" under older versions of Project and as I noted, doesn't appear to work correctly under Windows 10 (at least for me), although it may work under Windows 10 if applications are set to run as admin.
Using Application.ObjectLinks will open the Edit Links window and that will show all the OLE links in the current file. Unfortunately the link data presented is not very useful (i.e. only gives the project name and a link number). The "source" task can be identified by selecting a link and using the Open Source button but there is no "destination" info that identifies which task is the destination. You might be interested in reading this Wiki article:
https://social.technet.microsoft.com/wiki/contents/articles/32040.ms-project-hammock-tasks.aspx
John
- Gilgamesh1964Jun 14, 2021Brass ContributorThank you for all the information
That link was interesting.
I am now rethinking my use of Hammock Tasks.
I'm going to vent a little and say MS should invest some time into updating and improving the facility.- John-projectJun 14, 2021Silver Contributor
You're welcome and thanks for the feedback.
As far as requesting changes to Project, post your suggestion to the Project UserVoice at:
https://microsoftproject.uservoice.com/forums/914203-project-for-the-web
John