how to refer to custom fields in VBA

R

Robert X

Hello,

In the previous versions, I used to refer to custom fields by their standard
names like:
x = ActiveCell.Task.Duration1
In Project Server 2007, in the Enterprise Global, how will we refer to
custom fields? By their "custom name" or something else?
Thanks ahead

Robert
 
J

John

Robert X said:
Hello,

In the previous versions, I used to refer to custom fields by their standard
names like:
x = ActiveCell.Task.Duration1
In Project Server 2007, in the Enterprise Global, how will we refer to
custom fields? By their "custom name" or something else?
Thanks ahead

Robert

Robert,
I don't use Server and as yet I have limited experience with Project
2007, but the answer to your question is in the VBE object browser. For
example, the EnterpriseDurationn Property is used to set or read each of
the 10 Enterprise Duration fields for either a Task, Resource or
Assignment. I assume the same conventions holds for Project Server 2007.

Hope this helps.
John
Project MVP
 
R

Robert X

John,
In Project server 2007, Enterprise fields are created via PWA. I'm afraid we
cant refer to them the classical way :-(
Robert
 
J

John

Robert X said:
John,
In Project server 2007, Enterprise fields are created via PWA. I'm afraid we
cant refer to them the classical way :-(
Robert

Robert,
OK, then I must have misunderstood your original post. It sounded like
you were looking for a VBA method.

Hopefully someone more savy with Project Server 2007 will jump in and
help you out.

Sorry,
John
 
R

Rod Gill

Hi,

This has changed as there are no default Text, Number and Flag fields any
more, you just create them and attach them to Projects, Tasks, Resources or
Assignments and specify the data type they can hold. In the reporting
database, look at the Views and all View names ending with userview. They
have the custom fields as the last columns.

In VBA use:
msgbox "Custom Field Value= "&
ActiveProject.Tasks(1).GetField(FieldNameToFieldConstant("My Custom Field
Name"))

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
R

Robert X

Thanks a lot Rod,
But in which table of the Reporting DB do you find the View names ?
Thanks for your help!
 
R

Rod Gill

There are tables and there are Views in SQL Server. Get your friendly local
dba to list them for you. Primarily, just look at the ones with names ending
with userview.

Download the 2007 SDK from microsoft.com and look at the reporting database
schema it has.

The Tables in the reporting db are not that user friendly to use, hence the
Views.

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
R

Robert X

Thanks a lot Rod!


Rod Gill said:
There are tables and there are Views in SQL Server. Get your friendly
local dba to list them for you. Primarily, just look at the ones with
names ending with userview.

Download the 2007 SDK from microsoft.com and look at the reporting
database schema it has.

The Tables in the reporting db are not that user friendly to use, hence
the Views.

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 

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