Simple routine stops working in MSP2007

Microsoft Project


  • 1. VBA Event in Ms project on completion of task
    There has been need to change the background color of task when someone enters 100% there in % complete field of MS Project. Is that possible in VBA??? Bacause i see only taskbefore change event, Not Task after change event there.. Pls do reply -- Olivia
  • 2. Restricting the hours entered in Timesheet
    We have to restrict the users from entering more than 12 hrs per day. So we need to read the hours from timesheet in the pre-event of timesheet save and submit and then need to cancel those event if the user is entering more than 12 hours. We are able to read the timesheet hours only from the post event of save and submit. How to read the hours in the pre event of save and submit and then cancel if the hours are more than 12 hours? Thanks in Advance
  • 3. Updating a ProjectDataSet
    I have a very big problem. I can't update a ProjectDataSet with an assignment My code is: sessionId = Guid.NewGuid(); string sessionDesc = "Close task 1"; jobId = Guid.NewGuid(); projectWS.CheckOutProject(idProject, sessionId, sessionDesc); projectDs.Task[i].TASK_ACT_FINISH = DateTime.Now; ProjectDataSet.AssignmentRow assign = projectDs.Assignment.NewAssignmentRow(); assign.TASK_UID = projectDs.Task[i].TASK_UID; assign.RES_UID = resourceGuid; assign.PROJ_UID = idProject; assign.ASSN_UID = Guid.NewGuid(); projectDs.Assignment.AddAssignmentRow(assign); projectWS.QueueUpdateProject(jobId, sessionId, projectDs, false); WaitForQueue(QueueSystemWS, jobId); projectWS.QueuePublish(jobId, idProject, true, String.Empty); WaitForQueue(QueueSystemWS, jobId); projectWS.QueueCheckInProject(jobId, idProject, false, sessionId, sessionDesc); When I execute that, I receive in the message lasterror: "Only Updates Allowed" but if I replace projectWS.QueueUpdateProject for projectWS.QueueAddToProject I receive in the message lasterror: "Only Inserts Allowed" How I can update this ProjectDataSet?

Simple routine stops working in MSP2007

Postby SmltUw » Thu, 18 Mar 2010 00:53:02 GMT

I wrote a simple routine for my client that simply copied Text10 (task) to 
Text10 (assignment) so that when they viewed the Resource Usage layout, they 
could see the task's Text10. Here's the routine:

Sub TransferTaskText1ToAssignmentText1()
    Dim t As Task
    Dim a As Assignment
    Dim r As Resource
    On Error Resume Next
    For Each t In ActiveProject.Tasks
        For Each a In t.Assignments
            a.Text10 = t.Text10
        Next a
    Next t
End Sub
I do the Resume Next because they wouldn't know what to do if they saw an 
error box. Anyway, the routine worked perfectly in MSP2003, but after 
clearing the new security settings in MSP2007, it runs, but does not appear 
to have copied. 

I debugged it, and found that "a.Text10" is indeed showing as identical to 
"t.Text10" after the assignment statement. Yet the column in the Resource 
Usage view called "Text10" is not changed. 

This has to be something simple. Ideas?

Re: Simple routine stops working in MSP2007

Postby Jan De Messemaeker » Thu, 18 Mar 2010 01:32:09 GMT


You will find the whole explanation on this oddity in

Faq 37: Custom fields in tables.
The code you show probably comes from that faq but there is a newer version 
including the Project 2007 oddity and how to work around.

Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:

Re: Simple routine stops working in MSP2007

Postby SmltUw » Thu, 18 Mar 2010 02:49:01 GMT

Thank you, Jan. It worked like a charm.

Re: Simple routine stops working in MSP2007

Postby Jan De Messemaeker » Thu, 18 Mar 2010 03:55:43 GMT

You're welcome, Jim

Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:

Similar Threads:

1.Stop Actual Work from impacting Work

Hi, is it possible to enter a value in the actual work field without it 
making a change to the work field? 

In the timephased portion of the task usage view I enter a vlaue in the 
actual work cell for a given day but I don't want the work cell to change. So 
for a task that has work of 8 hours, I entered actual work of 5. I would like 
for work to remain at 8. 

Looking forward to answer. Thanks!

2.Entering values in Budget Cost & Budget Work in msp2007

I have the columns set up in my Resource Sheet, next to cost and work, but am 
not able to enter values in either Budget Cost or Budget Work columns, and I 
don't understand why.  Also, is there a way of linking those cells, or at 
least simply copying the data from Work to the Budget Work, and likewise for 
copying cost to Budget Cost?
John from NY

3.Disable fileds in 'My work' (MSP2007)


In ' My Work' view Start & Finish fields are mandatory fields
I want to disable the start date.

Can i disable the fields ?
shoham B

4.Holidays / non-working days for MSP2007


Are there any tables that stored the information regarding the
holidays or non-working days at all in MSP2007? I think in 2003, I saw

When the admin entered the Company's holidays into the MSP2007, what
tables that the holidays or non-working days information go? I realize
that the resource timesheets can be grayed out because the days have
been designated as a non-working days or holidays.

For example, Friday after Thanksgiving might be the holiday on some,
but it was the working days for many employers.

Some of the posts recommended using dbo_MSP_EpmResourceByDay_UserView
to differentiate the working and non-working days. Is this the only

I do appreciate your time responding to the questions. Thank you.

5.Simple Work View for a Resource


Is there a way to simply see a normal monthly calendar view (like the 
'month' calendar you see in Outlook) where it clearly denotes which days of 
the month a resource is scheduled to work?

I have a 3 month long project and I want to send each resource a view 
indicating "Here are your scheduled days of work. Plan your vacation 

Many Thanks!

6. VBA routine for Project to Edit Taskname field

7. Publishing routine when using MASTER projects.

8. Looking for VBA routine

Return to Microsoft Project


Who is online

Users browsing this forum: No registered users and 50 guest