How to programmatically create a blank line/task in MS Project?

S

Sausheong

I need to re-create a project plan from a set of data in a DB, and I've got
most of the project plan re-created. However I'm unable to create a blank
task and this causes the task dependencies to be out of sync. Can anyone help
me on this?
 
J

John

Sausheong said:
I need to re-create a project plan from a set of data in a DB, and I've got
most of the project plan re-created. However I'm unable to create a blank
task and this causes the task dependencies to be out of sync. Can anyone help
me on this?

Sausheong,
You posted in the developer newsgroup so I would assume you have
automated the process with VBA or some other method. However, in order
for us to help you, we need to know a little more about your process.

John
Project MVP
 
S

sausheong

Yes, I'm sorry for not giving clearer information. I'm currently using Ruby
to automate the task (instead of VBA, purely because I'm more familiar with
it) and it basically wraps around the MS Project Object Library, so anything
in VBA would be applicable for me as well. I can create normal tasks using
Task.Add "task_name" but I can't seem to create any blank tasks. I know that
it's merely a formatting issue but the links between the tasks do take into
consideration the blank tasks. When I re-create the tasks, the predecessor
and successor links will be broken if I don't create the blank tasks.

I've tried a hack around it by adding a nameless task e.g. Task.Add only but
it only succeeds in creating a nameless task with a duration of 1 day. If I
set the duration to 0 days, it turns into a milestone!

Thanks for your help in advance!
 
J

John

sausheong said:
Yes, I'm sorry for not giving clearer information. I'm currently using Ruby
to automate the task (instead of VBA, purely because I'm more familiar with
it) and it basically wraps around the MS Project Object Library, so anything
in VBA would be applicable for me as well. I can create normal tasks using
Task.Add "task_name" but I can't seem to create any blank tasks. I know that
it's merely a formatting issue but the links between the tasks do take into
consideration the blank tasks. When I re-create the tasks, the predecessor
and successor links will be broken if I don't create the blank tasks.

I've tried a hack around it by adding a nameless task e.g. Task.Add only but
it only succeeds in creating a nameless task with a duration of 1 day. If I
set the duration to 0 days, it turns into a milestone!

Thanks for your help in advance!

Sau,
I have never heard of "Ruby" so I can't help you there but if VBA is
equivalent, then the Add Method using for the Task object is all you
need.

I guess I don't understand what kind of "blank" task you are looking
for. In Project, a blank task is simply that, a task with no Task Name
but it will have an ID and a default duration and that blank task's ID
is taken into consideration when links are made. When tasks (including
blank tasks) are added or deleted, the links automatically adjust. So
what's the problem?

John
Project MVP
 

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

Ask a Question

Top