none
Project Server 2010 Macro and referring to Custom Enterprise Fields RRS feed

  • Question

  • I have a macro that was written in MS Project Server 2003 in which I am saving the value of an Enterprise field to a Public Const.  The code is as follows:

    Public Const WBSFIELD As Long = pjTaskEnterpriseText1

    Well in Project Server 2010 I can create Custom Enterprise Fields and I have done that.  I have created a Custom Enterprise Field called "WBS Std" which is replacing this old pjTaskEnterpriseText1 field. 

    How do I create a Public Const of that field?  When I tried

    Public Const WBSFIELD As Long = FieldNameToFieldConstant("WBS Std", pjTask)

    I got the following error:  Compile error:  Constant expression required.

    Any help would be greatly appreciated!!!!  I have around 60 fields that I am doing this for.

    Thanks,

    kcsmiles

    Wednesday, March 26, 2014 8:42 PM

All replies

  • I ended up not using the above Public Const command, I could never get it to work and I never got a response from anyone.  What I ended up doing was just refering the FieldNameToFieldConstant("WBS Std", pjTask) every time I wanted to use that field.  I don't think it was the best way to handle it, but it works.   Thanks,  Casey
    Monday, September 8, 2014 2:01 PM