Can I write to a Project ECF within VBA

B

Ben Howard [MVP]

Hi,
I have a couple of Project ECFs that I'd like to write to. How do I
idenfity the ECF names?
 
B

Ben Howard [MVP]

I've just read that you cannot edit server custom fields using VBA, so I
guess that answers my question. Any work arounds would be useful!
 
J

Jan De Messemaeker

Hi Ben,

Yes we can :)
On a file open in Professional use
fieldnametofieldconstant to get the field id
then use Getfield to read, Setfield to write.

HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
J

Jan De Messemaeker

Hi Ben,

Yes we can :)
On a file open in Professional use
fieldnametofieldconstant to get the field id
then use Getfield to read, Setfield to write.
Definitely works for Task and Resource ECFs

Project level ECFs are (if memory serves me right, not done this recently)
addressed through the Project Summary Task.

HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf

(e-mail address removed)...
 
B

Ben Howard [MVP]

Hi Jan, thanks, I'll try this. Thanks for helping, I'm sure I'll have lots
more Q's!
 
R

Rod Gill

Ben,

Have you left my book at home again? Page 442 my friend!!

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Ben Howard said:
Hi,
I have a couple of Project ECFs that I'd like to write to. How do I
idenfity the ECF names?
--
Regards, Ben.

__________ Information from ESET Smart Security, version of virus
signature database 4811 (20100127) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4811 (20100127) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
B

Ben Howard [MVP]

Hi Rod, You know me, I never got beyond module 3! Seriously though, pg 442
isn't listed under Custom Fields in the index, so I didn't find it. Now I
have, my code is finished - hurrah! - thank you :)

Can you explain the wording "ECF details are Read-Only in Project Pro" - I
had taken this to read the actual value, but I'm guessing it means the field
type, lookup table etc?
 
R

Rod Gill

Yes they are read-only. VBA can only do pretty much what you can do
manually. As you can't edit Custom fields in Project Server 2007 Pro you
can't in VBA either!

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Ben Howard said:
Hi Rod, You know me, I never got beyond module 3! Seriously though, pg
442
isn't listed under Custom Fields in the index, so I didn't find it. Now I
have, my code is finished - hurrah! - thank you :)

Can you explain the wording "ECF details are Read-Only in Project Pro" - I
had taken this to read the actual value, but I'm guessing it means the
field
type, lookup table etc?
--
Regards, Ben.




__________ Information from ESET Smart Security, version of virus
signature database 4815 (20100128) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4815 (20100128) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
J

Jack Dahlgren MVP

Rod,

I think the term "edit" as you use it is confusing. You definitely CAN edit
the value stored in a custom field. You can't change the properties of the
custom field (data type, formula etc.) and I think it is easy for someone to
interpret your statement as covering both of these - especially since there
are some tricks to edit enterprise custom field values.

-Jack Dahlgren
 
R

Rod Gill

Thanks Jack, I did mean edit properties. Must have been either short of
coffee or too late in the day for me (local time)!

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Jack Dahlgren MVP said:
Rod,

I think the term "edit" as you use it is confusing. You definitely CAN
edit the value stored in a custom field. You can't change the properties
of the custom field (data type, formula etc.) and I think it is easy for
someone to interpret your statement as covering both of these - especially
since there are some tricks to edit enterprise custom field values.

-Jack Dahlgren



__________ Information from ESET Smart Security, version of virus
signature database 4823 (20100201) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4823 (20100201) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

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