Go Back   TechArena Community > Technical Support > Computer Help > Office Help > Microsoft Project
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: ,

Sponsored Links



[ask] about VB Script + Ms. Project

Microsoft Project


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-02-2009
Member
 
Join Date: Feb 2009
Posts: 9
[ask] about VB Script + Ms. Project

hi guys, i'm new guy in here..but i really needs your help..

how to make algorithm for cumulative work at current date (at Task Usage view) and write it to another field like Text01?

regards,
Reply With Quote
  #2  
Old 25-02-2009
Gérard Ducouret
 
Posts: n/a
Re: [ask] about VB Script + Ms. Project

Hello anak_baru,

In the Task Usage view, you can display the Cumulative Work : right Cclick
in a yellow cell....
Otherwise, you can write a VBA procedure using the TimeScaleData method to
do that.

Gérard Ducouret

"anak_baru" <anak_baru.3o5k3e@DoNotSpam.com> a écrit dans le message de
news: anak_baru.3o5k3e@DoNotSpam.com...
>
> hi guys, i'm new guy in here..but i really needs your help..
>
> how to make algorithm for cumulative work at current date (at Task
> Usage view) and write it to another field like Text01?
>
> regards,
>
>
> --
> anak_baru
> ------------------------------------------------------------------------
> anak_baru's Profile: http://forums.techarena.in/members/anak_baru.htm
> View this thread: [ask] about VB Script + Ms. Project
>
> http://forums.techarena.in
>



Reply With Quote
  #3  
Old 25-02-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

Quote:
Originally Posted by Gérard Ducouret View Post
Hello anak_baru,

In the Task Usage view, you can display the Cumulative Work : right Cclick
in a yellow cell....
Otherwise, you can write a VBA procedure using the TimeScaleData method to
do that.

Gérard Ducouret

"anak_baru" <anak_baru.3o5k3e@DoNotSpam.com> a écrit dans le message de
news: anak_baru.3o5k3e@DoNotSpam.com...
>
> hi guys, i'm new guy in here..but i really needs your help..
>
> how to make algorithm for cumulative work at current date (at Task
> Usage view) and write it to another field like Text01?
>
> regards,
>
>
> --
> anak_baru
> ------------------------------------------------------------------------
> anak_baru's Profile: http://forums.techarena.in/members/anak_baru.htm
> View this thread: [ask] about VB Script + Ms. Project
>
> http://forums.techarena.in
>
can you give me an example please..what type of timescaledata?
Reply With Quote
  #4  
Old 25-02-2009
Gérard Ducouret
 
Posts: n/a
For example, a VBA procedure which copies the actual Work into Baseline10:

Gérard Ducouret

For Each oTâche In ActiveProject.Tasks
i = 0
For Each Ass In oTâche.Assignments
i = i + 1
Deb = oTâche.Assignments(i).Start
Fin = oTâche.Assignments(i).Finish

Set TSVs = oTâche.Assignments(i).TimeScaleData(Deb, Fin,
Type:=pjAssignmentTimescaledActualWork, _
TimeScaleUnit:=pjTimescaleDays, Count:=1)

Set TSVs2 = oTâche.Assignments(i).TimeScaleData(Deb, Fin,
Type:=pjAssignmentTimescaledBaseline10Work, _
TimeScaleUnit:=pjTimescaleDays, Count:=1)

For Each TSV In TSVs
Debug.Print i & " Début période: " & Format(TSV.StartDate, "Long
Date"), "Travail réel: " & Val(TSV.Value) / 60 & "h", oTâche.Name,
Ass.ResourceName, "Index de tranche :" & TSV.Index
'NB : Val(TSV.Value) convert the empty string to a zero
IndexCell = TSV.Index

For Each TSV2 In TSVs2
If TSV2.Index = IndexCell Then
TSV2.Value = Val(TSV.Value) '/ 60
End If
Next TSV2

Next TSV
Next Ass
Next oTâche
Reply With Quote
  #5  
Old 25-02-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

Quote:
Originally Posted by Gérard Ducouret View Post
For example, a VBA procedure which copies the actual Work into Baseline10:

Gérard Ducouret

For Each oTâche In ActiveProject.Tasks
i = 0
For Each Ass In oTâche.Assignments
i = i + 1
Deb = oTâche.Assignments(i).Start
Fin = oTâche.Assignments(i).Finish

Set TSVs = oTâche.Assignments(i).TimeScaleData(Deb, Fin,
Type:=pjAssignmentTimescaledActualWork, _
TimeScaleUnit:=pjTimescaleDays, Count:=1)

Set TSVs2 = oTâche.Assignments(i).TimeScaleData(Deb, Fin,
Type:=pjAssignmentTimescaledBaseline10Work, _
TimeScaleUnit:=pjTimescaleDays, Count:=1)

For Each TSV In TSVs
Debug.Print i & " Début période: " & Format(TSV.StartDate, "Long
Date"), "Travail réel: " & Val(TSV.Value) / 60 & "h", oTâche.Name,
Ass.ResourceName, "Index de tranche :" & TSV.Index
'NB : Val(TSV.Value) convert the empty string to a zero
IndexCell = TSV.Index

For Each TSV2 In TSVs2
If TSV2.Index = IndexCell Then
TSV2.Value = Val(TSV.Value) '/ 60
End If
Next TSV2

Next TSV
Next Ass
Next oTâche
error bro, can u write full script..i'm new at VB, sorry..^^
Reply With Quote
  #6  
Old 26-02-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

Quote:
Originally Posted by Gérard Ducouret View Post
You should look at the Rod Gill's book:

Author of the only book on Project VBA, see:
http://www.projectvbabook.com

Gérard Ducouret
i just don't know about dimension for oTâche, Ass, TSV, TSV2, TSVs, TSVs2, Deb, Fin, can you write they dimension?

really thanks,.
Reply With Quote
  #7  
Old 26-02-2009
Member
 
Join Date: Feb 2009
Posts: 9
anak,

Hereafter is the declaration of my dimensions for this procedure:

Sub CopyActuals()
Dim TSV As TimeScaleValue, TSV2 As TimeScaleValue
Dim TSVs As TimeScaleValues, TSVs2 As TimeScaleValues
Dim oTâche As Task
Dim Ass As Assignment
Dim Deb As Date, Fin As Date
Dim NomRess As String, RessID As Integer
Dim i As Integer, Hrs_jr As Long, HowMany As Long, IndexCell As Integer
Reply With Quote
  #8  
Old 05-03-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

failed for summary task..:(
some summary task failed (error result), some summary task success..

can u help me again?

can u add my Yahoo Messenger? erry_32@yahoo.com
Reply With Quote
  #9  
Old 05-03-2009
Gérard Ducouret
 
Posts: n/a
Re: [ask] about VB Script + Ms. Project

anak_baru,

If your project is not confidential, you can send it to me : you have my
email address, just REMOVETHIS and THAT.
And explain me what you want to do with this VBA procédure.

Gérard Ducouret

"anak_baru" <anak_baru.3ok7vb@DoNotSpam.com> a écrit dans le message de
news: anak_baru.3ok7vb@DoNotSpam.com...
>
> failed for summary task..:(
> some summary task failed (error result), some summary task success..
>
> can u help me again?
>
> can u add my Yahoo Messenger? erry_32@yahoo.com
>
>
> --
> anak_baru
> ------------------------------------------------------------------------
> anak_baru's Profile: http://forums.techarena.in/members/anak_baru.htm
> View this thread: [ask] about VB Script + Ms. Project
>
> http://forums.techarena.in
>



Reply With Quote
  #10  
Old 06-03-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

Quote:
Originally Posted by Gérard Ducouret View Post
anak_baru,

If your project is not confidential, you can send it to me : you have my
email address, just REMOVETHIS and THAT.
And explain me what you want to do with this VBA procédure.

Gérard Ducouret
ok, no problem, i can share my project with REMOVETHIS and THAT..
but..where i must sent my file, i need your email?
Reply With Quote
  #11  
Old 06-03-2009
Gérard Ducouret
 
Posts: n/a
Re: [ask] about VB Script + Ms. Project

Erry,

1° - Most of your Summaries don't have any resource (which is complying with
the best practices). But your VB Script works only when there is at least a
resource which generates work.
2° - In the Number1 custom field, renamed "Target 2 (Value)" you have a long
formula which returns sometimes a result as a string such as "Not Yet
Started". So you get a #Error.

Hope this helps,

Gérard Ducouret



Reply With Quote
  #12  
Old 06-03-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

Quote:
Originally Posted by Gérard Ducouret View Post
Erry,

1° - Most of your Summaries don't have any resource (which is complying with
the best practices). But your VB Script works only when there is at least a
resource which generates work.
2° - In the Number1 custom field, renamed "Target 2 (Value)" you have a long
formula which returns sometimes a result as a string such as "Not Yet
Started". So you get a #Error.

Hope this helps,

Gérard Ducouret
1. any suggestion for this? i just want to take cumulative work for every task (included for summary task too) for current date

2. i know that, i have fixed it..
Reply With Quote
  #13  
Old 10-03-2009
Member
 
Join Date: Feb 2009
Posts: 9
Re: [ask] about VB Script + Ms. Project

anyone can help me? please..
Reply With Quote
  #14  
Old 10-03-2009
Dave
 
Posts: n/a
Re: [ask] about VB Script + Ms. Project

anak_baru wrote:
> anyone can help me? please..


You might find it easier to export the work to Excel and do the sums there.
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Office Help > Microsoft Project


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "[ask] about VB Script + Ms. Project"
Thread Thread Starter Forum Replies Last Post
Project Prof 2007 not opening when new project created in Project Server website GroundLoop Microsoft Project 1 30-01-2011 08:59 AM
Word 2008 + bibfuse: no script in script menu deval4u Software Development 5 06-04-2009 01:53 PM
Sub-Project - Project Summary Tasks showing on a Master Project Steve Scott Microsoft Project 3 16-01-2009 11:14 PM
Problem with script in order to open another script in an extra window Samsher Software Development 2 14-01-2009 01:25 PM
Microsoft Project crashes when trying to open a project from Project Server bophommarath@yahoo.com Microsoft Project 1 09-05-2005 02:39 PM


All times are GMT +5.5. The time now is 12:05 AM.