task usage pane locked for editing after updates in vba

R

Rudyvdg

I run vba code using timescaledata to update resource timesheet with data
from another application. This runs fine for a while but at some point
(undeterminable) the timescaledata function fails an no more values can be
added.
Tried to add a value manually but the task pane seems to be locked for
updates.

Close project and re-open and all becomes editable again.

1. What could be the cause?
2. Is there a way to prevent it or is there a way to force an unlock from VBA?

Thanks
Rudy
 
R

Rod Gill

Approximately how many entries causes this effect? If you manually enter the
same number of values do you get the same result?

This could be caused by a file corruption. Try saving the file to .xml via
the File, Save as option and choosing xml as the file type. Then re-open the
xml file to import back into a new project (follow the wizard prompts that
appear).

Does the fault happen in the new copy?

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
R

Rudyvdg

Thanks Rod,

The number of entries were many (I am recording a maintenance project over
at least 6 months) so we are talking in the region of 6/7000 entries, MP
seems to get confused about 3/4 of the way. Manual entries are not an option
with that number. I have tried splitting it up into smaller bits and that
seems to have done the trick. So never really found out what the root cause
was but feel that there is a limit as to the number of entries you can add in
one run.
Thinking of that is there a way to tidy up the project (like compact in
ACCESS) or is that done behind the scenes?

Thanks for your help in the meantime

Regards
Rudy
 
R

Rod Gill

The only time Project does any house keeping on a .mpp file is if you open
it then save immediately. Alternatively do a file, save as.

I created a task in a new file, gave it a duration of 8000d, assigned one
resource at 20%. The following code ran with no problems:

Sub test()
Dim Tsk As Task
Dim Count As Long
Dim tsvs As TimeScaleValues
Set Tsk = ActiveProject.Tasks(1)
Set tsvs = Tsk.Assignments(1).TimeScaleData(Tsk.Start, Tsk.Finish,
pjAssignmentTimescaledWork, pjTimescaleDays)
For Count = 1 To 8000
If tsvs(Count).Value <> "" Then
tsvs(Count).Value = 60
End If
Next
End Sub

May be the file has a corruption somewhere? Try saving into .xml format,
then import back to proejct and save as .mpp again.

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 

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