C
Coolpran
Hi
Let me start by saying that I am new to Project Server and the whole EPM
phenomenon.
However, I am working with Project Server 2003 and I need to do develop a
custom VBA form in the Enterprise Global.
I have set up lookup tables for several Custom Outline Codes in the
Enterprise Global. By Custom Outline Code I mean the ones you set up by
going to Tools->Customize->Enterprise Fields->Custom Outline Codes ->Choose
Project Radio button
Now, in my VBA Form, I want to populate a dropdown with values from the
lookup tables above.
I found that I could do it by reading the Application.GlobalOutlineCodes,
then loop through all the outline codes till I find a match and then read
the lookup table values.
The code I am using is:
'----- code starts here ----
Dim oc As OutlineCode
Dim lt As LookupTable
Dim lte As LookupTableEntry
Dim entOutlineCodes As OutlineCodes
Dim OLcode As Long
Dim myCount As Integer
myCount = 0
EntOLCode14 = 188744602 ' Value for
pjTaskEnterpriseProjectOutlineCode14 "Task Enterprise Project Outline
Code14"
Set entOutlineCodes = Application.GlobalOutlineCodes
For Each oc In entOutlineCodes
OLcode = oc.FieldID
Select Case OLcode
Case EntOLcode14 ' Proj Mgr
Set lt = oc.LookupTable
Debug.Print "--Start of Project Manager loop at " & Now &
"---"
For Each lte In lt
cboProjMgr.AddItem lte.FullName
Next
cboProjMgr.Value =
ActiveProject.ProjectSummaryTask.GetField(pjTaskEnterpriseProjectOutlineCode14)
txtProjMgr.Value = cboProjMgr.Value
... other case statements
End Select
Next
'----- code ends here -----
The For loop is taking a lot of time to execute.
Is there an elegant solution which will allow me to read just the required
outline code without the loop?
I searched on Google Groups and found a similar answer posted by Evgeniy
(http://groups.google.com/group/micr...ee0795bb7e3/23460d81b74e1d9a#23460d81b74e1d9a)
The code he mentioned was
'---- code starts here -----
Dim tsk As msproject.Task
MsgBox (tsk.GetField(pjTaskEnterpriseProjectOutlineCode14))
'---- code ends here ------
But this is not working for me. Its giving an error "Object variable or With
block variable not set"
Also the MSDN documentation on this topic is very sparse.
Can anyone please help.
Thanks
Coolpran
Let me start by saying that I am new to Project Server and the whole EPM
phenomenon.
However, I am working with Project Server 2003 and I need to do develop a
custom VBA form in the Enterprise Global.
I have set up lookup tables for several Custom Outline Codes in the
Enterprise Global. By Custom Outline Code I mean the ones you set up by
going to Tools->Customize->Enterprise Fields->Custom Outline Codes ->Choose
Project Radio button
Now, in my VBA Form, I want to populate a dropdown with values from the
lookup tables above.
I found that I could do it by reading the Application.GlobalOutlineCodes,
then loop through all the outline codes till I find a match and then read
the lookup table values.
The code I am using is:
'----- code starts here ----
Dim oc As OutlineCode
Dim lt As LookupTable
Dim lte As LookupTableEntry
Dim entOutlineCodes As OutlineCodes
Dim OLcode As Long
Dim myCount As Integer
myCount = 0
EntOLCode14 = 188744602 ' Value for
pjTaskEnterpriseProjectOutlineCode14 "Task Enterprise Project Outline
Code14"
Set entOutlineCodes = Application.GlobalOutlineCodes
For Each oc In entOutlineCodes
OLcode = oc.FieldID
Select Case OLcode
Case EntOLcode14 ' Proj Mgr
Set lt = oc.LookupTable
Debug.Print "--Start of Project Manager loop at " & Now &
"---"
For Each lte In lt
cboProjMgr.AddItem lte.FullName
Next
cboProjMgr.Value =
ActiveProject.ProjectSummaryTask.GetField(pjTaskEnterpriseProjectOutlineCode14)
txtProjMgr.Value = cboProjMgr.Value
... other case statements
End Select
Next
'----- code ends here -----
The For loop is taking a lot of time to execute.
Is there an elegant solution which will allow me to read just the required
outline code without the loop?
I searched on Google Groups and found a similar answer posted by Evgeniy
(http://groups.google.com/group/micr...ee0795bb7e3/23460d81b74e1d9a#23460d81b74e1d9a)
The code he mentioned was
'---- code starts here -----
Dim tsk As msproject.Task
MsgBox (tsk.GetField(pjTaskEnterpriseProjectOutlineCode14))
'---- code ends here ------
But this is not working for me. Its giving an error "Object variable or With
block variable not set"
Also the MSDN documentation on this topic is very sparse.
Can anyone please help.
Thanks
Coolpran