Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing Timescaledata entries!? 1

Status
Not open for further replies.

DrSimon

IS-IT--Management
Dec 14, 2001
674
GB
Has anyone encountered a bizarre observation and hopefully offer a solution. I have an application that has successfully extracted timescaledata from at least 20 different project plans produced by other people. I have just received a plan that is accountably is missing values if I compare them to the Resource Usage view. For example if TimescaleUnit:=pjTimescaleQuarters the first quester is missing if it's set to pjTimescaleDays the first 3 days are missing. The days missing are 23-25th July 2007 ansd I ahve checked the calendar for one the resources and thse days are normal weekdays with noral working hours.
I normally run the application in Accees, but have quickly written some code in MS Prject and got the same result

Has anyone any ideas as to where I can start looking?

Many Thanks

Simon
 
Tools > Options > Calculation-tab
Is the mode set to Automatic?

What version of Prj are you using?

email a copy to me: PDQBach4100 at h0tmail.com and I'll see if I have the same issues as you.
 
Thanks PDQ
Calculation is set to Automatic.
I'm using MSP 2003, Access 2003 and XP but the tool also works with Vista, MSP2003 and Access 2007, as well as Vista MSP2007 and Access 2007.
Thank you for the offer but I'm not sure if I can send out the plan as it could be commercially sensitive. I'll see if I can anonymise it at all.
It sounds odd though doesn't it?

Regards
Simon
 
Yes, really weird.

View > Gantt
Display the Unique ID column
Copy the UniqueID column and paste it over the Name column.

View > Resource Sheet
Display the Unique ID column
Copy the UniqueID column and paste it over the Name column.

That should make it sufficiently obscure.
 
PDQ
Thanks for at least starting to take this on. The code below isn't the real code I use which is Access, I am only using it to try to debug the problem. You will see that it specifically debugs the second resource which is one of those that is playing up.
Code:
Sub SRTemp()
Dim R As Resource
Dim Resource_Name As String
Dim TSVn As Integer
Dim RCount As Integer
        For Each R In ActiveProject.Resources
             RCount = RCount + 1
             Set TSV = R.TimeScaleData(DateFormat(ActiveProject.ProjectStart, pjDate_mm_dd_yy), DateFormat(ActiveProject.ProjectFinish, pjDate_mm_dd_yy), _
                                      TimescaleUnit:=pjTimescaleQuarters)
            If RCount = 2 Then Debug.Print R.Name
            For TSVn = 1 To TSV.Count
                If TSV(TSVn).Value <> "" Then
                    If RCount = 2 Then Debug.Print TSV(TSVn).StartDate, TSV(TSVn).Value / (60 * ActiveProject.HoursPerDay)
                Else
                    If RCount = 2 Then Debug.Print TSV(TSVn).StartDate
                End If
            Next TSVn
        Next R
End Sub
If you run this and then look at Resource Usage view for Resource '2' with Quarter as the bottom tier for timescale, you will see that the last 3 quarters are there but not the first 2. If you put a break in and look at the local variable TSV you will also see those only 3 items. My problem is obviously - where have the missing ones gone to?

Many Thanks

Simon Rouse
 
Hi PDQ
I was just wondering if you'd had any thoughts about this?

Many Thanks
Simon
 
Apologies, Simon. I have been completed swamped at work plus my "after hours" time has been completely taken over by some volunteer work I do. I'm actually looking at the problem now -- no solution yet -- and will focus on it this weekend. Again, please accept my apologies.
 
I have discovered the issue -- and I would *never* have expected it.

Open the project
Project > Project Information ...

You can arbitrarily set the Start date to any date you want. If a task has no actual work and is set as ASAP and isn't constrained by links to earlier/later tasks then it will move to reflect a change in the Project start date.

If, however, it has some actual work or it is linked to an earlier task with actual work (and there may be other conditions) then it is "locked" and if the Project Start date is set to a date later than the task start then the action will be successful and no error/warning diagnostic will be raised.

This is important because you were picking up the Start and Finish dates from the Project summary record and passing those dates to the TSV function. The file you provided had a Project Start date of Apr 1, 2009 (if I remember correctly). As soon as I changed the project start date to Jan 1, 2005, I could see your missing quarters of information.

Your next question is likely to be: how can you get an accurate Start/Finish pair of dates?

Put these two lines of code at the top of your VBA code:

ProjectSummaryInfo ScheduleFrom:=2
ProjectSummaryInfo ScheduleFrom:=1

They will set the schedule to "Schedule from Finish" and then "Schedule from Start". That change forces the Project Start Date to accurately reflect the start date of the earliest task in the project file.

You owe me a hand-pulled draft pint. <grin>


 
Hey PDQ
I've never seen that method and I thought it was going to be 'IT'. Unfortunately I got Run-time error 1100 - 'The method is not available in this situation'. I've tried placing it in various places including before and after CreateObject() and GetObject() statements, but no go. Any ideas?
You are definitely on the right lines though - I changed the Project Start date to one day before the start date of the first task and it worked!

Simon
 
It works on all three environments that I have access to.

In VBA
Tools > References

I have check marks next to:
Visual Basic for Applications
Microsoft Project 11.0 (or 12.0) Object Library
OLE Automation
Microsoft Office 11.0 Object Library

All I did was place those two statements after the last DIM statement in your code above.
 
Or you could manually
Project > Project Information...
Change "Schedule from:" to Project Finish Date
OK

Then repeat the process and set it to Project Start Date.

Not elegant but, once you've done it, the change is "sticky" (until, of course, somebody changes the Start Date again.
 
Or you could go
Tools > Macro > record new macro
Project > Project Information... change the project to "Schedule from finish date" and click on OK
Project > Project Information... change the project to "Schedule from start date" and click on OK
Tools > Macro > Stop Recorder
and examine the VBA code generated by Project.

 
Hi PDQ
Thanks so much for all the time you've been spending on this. My problem with ProjectSummaryInfo only relates to the Access application. All the references you listed were already there.
Failing anything else I may just loop through all the tasks, find the earliest start date and latest finish date, add a day on either side and use them as the first 2 arguments of TimeScaleData rather than ProjectStart and ProjectFinish. That should work shouldn't it?
Thanks Again
Simon
 
If it's a standalone instance of Access then, yes, I think that should work.

But if you've got an Access macro that actually loads an instance of Project which, in turn, opens the file then I think it is possible to do the Project commands using a construct similar to (I'm no expert here)

MSProject.ProjectSummaryInfo ScheduleFrom:=2
or maybe
application.MSProject.ProjectSummaryInfo ScheduleFrom:=2
or maybe
application.ProjectSummaryInfo ScheduleFrom:=2

Other than that, I'm out of thoughts here.

Thank you for patience (it's been a madhouse at work for the past couple of weeks!).

 
None of those worked, nor various others that I tried.

So I'm back to plan B of checking all the tasks.

Thanks for your perseverance at this. Sadly all I can give you is a star and can't send you the pint or two that you deserve here.

Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top