Setting ActiveCell

R

Robert

Hi all,

Can somebody please help me with the following question.

I have made an application that can add resources to the task in the
activecell.

I also have an application that can add a new task to any place in the
tasklist. It would be nice when this second application can start the
first application (add resources to task by using activecell).

Can you tell me how to change the activecell in MS Project(by using
VBA), so the first application starts with the correct task to add
resources to.

I tried a lot of things myself, but can't figure it out so far. I hope
somebody can help me.

Tnx in advance,

Robert
 
G

Gérard Ducouret

Hello Robert
Try the following VBA procedure :

Sub Affectation()
Dim Num As Integer
Num = ActiveCell.Task.ID
ActiveProject.Tasks(Num).Assignments.Add ResourceID:=1, Units:=0.5
End Sub

HTH

Gérard Ducouret
 
R

Robert

Hi Gerard,

Thanks for your quick reaction. I found the solution this morning in
the following code:

ActiveProject.Application.SelectRow Row:=5, rowrelative:=False

Which automatically switches to the given row from the Row-parameter
and makes that row the activecell. Then you can easily read now the
activecell.

Thanks for your help,

Robert
 

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