Couple Project 2k3 Pro VBA questions

M

Morgan

Hi all, thanks in advance for any responses.

1-How would I programaticaly add a formula to the column "Date1"? I know
how to do it in Proj.
2-Is there some secret to writting to an enterprise field? Using
(activeprojects.tasks(x).enterpriseprojecttext1="whatever") gives me an
error (object expected) but if i use the exact same structure
(activeprokects.tasks(x).text1="whatever") it works.

Thanks

Morgan
 
J

John

Morgan said:
Hi all, thanks in advance for any responses.

1-How would I programaticaly add a formula to the column "Date1"? I know
how to do it in Proj.
2-Is there some secret to writting to an enterprise field? Using
(activeprojects.tasks(x).enterpriseprojecttext1="whatever") gives me an
error (object expected) but if i use the exact same structure
(activeprokects.tasks(x).text1="whatever") it works.

Thanks

Morgan

Morgan,
I'm a little confused. If you know how to add a formula via VBA in
"Proj" (I assume that means Project 2003 Standard), then Project 2003
Pro is no different. Am I missing something?

The secret to writing to Enterprise fields is first of all, Enterprise
fields are created at Server level. Second, you need to have
administrative rights to write to Enterprise fields.

Hope this helps.
John
Project MVP
 
M

Morgan

Darn was hoping to get a quick answer without the whole spiel, here it goes.
I am working on creatting custom macros that reside in the global enterprise
project on my "all in one" windows server 2003, project server 2003, wss
2.X, project professional 2k3,sql server 2000 spX.
whew, ok now back to the original issue.
"Enterprise fields are created at Server level. Second, you need to have
administrative rights to write to Enterprise fields."
Enterprise fields reside in the checked out enterprise project, they can be
read using the activeprojects.tasks(x).enterpriseprojecttext1, yet cannot be
written... I am the admin.
The error is object expected, not getting any kind of obvious permission
errors.

I read in a newsgroup somewhere about the enterprise fields having to be
subtasks? in order to write directly to them.. (beats me)


1-How would I programaticaly add a formula to the column "Date1"? I know
how to do it in the project gui, just not though vba.

Thanks Again.

R
 
J

JackD

For setting a formula try:

CustomFieldSetFormula FieldID:=pjCustomTaskText1, Formula:="<your formula
here>"

You will of course replace <your formula here> with the appropriate text
string.

You can just cut and paste from the formula window if you like.

CustomFieldSetFormula FieldID:=pjCustomTaskText1, Formula:=""w" &
Format(DateAdd("d",7-Weekday([Finish]),[Finish]),"ww" & "'yy")"
 
J

John

Morgan said:
Darn was hoping to get a quick answer without the whole spiel, here it goes.
I am working on creatting custom macros that reside in the global enterprise
project on my "all in one" windows server 2003, project server 2003, wss
2.X, project professional 2k3,sql server 2000 spX.
whew, ok now back to the original issue.
"Enterprise fields are created at Server level. Second, you need to have
administrative rights to write to Enterprise fields."
Enterprise fields reside in the checked out enterprise project, they can be
read using the activeprojects.tasks(x).enterpriseprojecttext1, yet cannot be
written... I am the admin.
The error is object expected, not getting any kind of obvious permission
errors.

I read in a newsgroup somewhere about the enterprise fields having to be
subtasks? in order to write directly to them.. (beats me)


1-How would I programaticaly add a formula to the column "Date1"? I know
how to do it in the project gui, just not though vba.

Thanks Again.

R

Morgan,
Sometimes a little more information can make all the difference.

I'm just starting to learn about Enterprise fields myself. I was not
aware that they had any conditions regarding subtasks only - that
doesn't make sense. Did you do a search to find the information you
thought you saw? Regardless, if you are the administrator why not try a
simple test to see if the subtask connection is valid?

I think Jack answered your question about creating formulas via VBA.

John
Project MVP
 

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