Programmatically Changing Hours Worked Fields in Project 2003

S

slide23

I am using Project 2003 Pro and attempting to populate the hours worked
fields from a CSV or XLS. I cannot seem to find anything in the object model
or in any code samples that will let me change the hours for individual days.

Here are the specifics: I have an XLS or CSV with employee hours and
projects they are working on. Some of the projects are tracked in MS
Project. Rather than manually keying in everyone's hours worked for a two
week period, I would like to parse out the file and populate the hours for
the pertinent dates using an app. So, how do I get access to these fields in
code?

Thanks for any information you can provide.
 
J

John

slide23 said:
I am using Project 2003 Pro and attempting to populate the hours worked
fields from a CSV or XLS. I cannot seem to find anything in the object model
or in any code samples that will let me change the hours for individual days.

Here are the specifics: I have an XLS or CSV with employee hours and
projects they are working on. Some of the projects are tracked in MS
Project. Rather than manually keying in everyone's hours worked for a two
week period, I would like to parse out the file and populate the hours for
the pertinent dates using an app. So, how do I get access to these fields in
code?

Thanks for any information you can provide.

slide23,
I don't know how much experience you have with Project VBA but you need
to work with the Assignments Collection object. For that object use the
Add Method on the TimescaleValues Collection object.

I don't know of any sample code that does this particular operation,
(most VBA macros export data out of Project to another application), but
I can give you a couple of references. First you might want to take a
look at fellow MVP, Jack Dahlgren's website at:
http://masamiki.com/project/macros.htm
Specifically, take a look at Jack's macro "Export hierarchy to Excel".
It shows how to control one application from another. You would need to
reverse the flow (i.e. Excel to Project) but the basics are there.

Also fellow MVP, Rod Gill, wrote an excellent book on Project VBA. It
has a ton of examples including how to work with the TimeScaleDate
Method and working between applications. It is available oat:
http://www.projectserverbooks.com The book is also available at
Amazon or BN.Com.

If you have specific questions about code details, please post to our
other newsgroup that concentrates on developer issues, including Project
VBA. (microsoft.public.project.developer).

Hope this helps.
John
Project MVP
 
G

Gérard Ducouret

Slide23,

In the VBA Help, look at the TimeScaleData method
Hope this helps

Gérard Ducouret
 
S

slide23

John and Gérard,

Thank you very much for your replies. This helps me immensely and looks to
be precisely what I need. I am ordering Rod Gill's book as soon as I hit
"Send" on this post.

Thanks again.
 
J

John

slide23 said:
John and Gérard,

Thank you very much for your replies. This helps me immensely and looks to
be precisely what I need. I am ordering Rod Gill's book as soon as I hit
"Send" on this post.

Thanks again.

slide23,
You're welcome.

John
 

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