Jun 09 2021 12:33 AM
Jun 09 2021 12:33 AM
I have two questions about Hammock Tasks and VBA.
Creating the Task
I have recorded a macro and had a look at how it is set up, the macro records the actual Copy and Paste steps.
Is there any other way of doing this in VBA? Such as referring to Task variables. I think Copy and Paste (which relies on Start and Finish being displayed) is limited.
Determining if a task is a hammock task
This one is actually the main question
When I loop through the tasks such as
For each oTask in ActiveProject.Tasks
Is there anyway of determining if the objTask.Start and objTask.Finish fields have links in them?
If they both do then I can assume that it is a hammock task
Jun 09 2021 08:26 AM
Jun 09 2021 10:07 PM
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
Jun 10 2021 08:14 AMSolution
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:
Jun 14 2021 03:34 AM
Jun 14 2021 07:48 AM - edited Jun 14 2021 08:00 AM
You're welcome and thanks for the feedback.
As far as requesting changes to Project, post your suggestion to the Project UserVoice at: