Accessing Columns

Q

q.p. person

How does one determine within a macro which columns are being displayed in
the active view? Is there a "Columns" collection somewhere within the
Project object model?

Thanks
 
J

John

Q.P.
I think you may be approaching it from the wrong direction. Although I
believe it is possible to find out which columns are being displayed by
virtue of which view table is active and the makeup of that table, you
may be better off to set the active view to a known configuration. This
is done with the TableEdit Method.

As far as finding out what is avaiable in the Project object model,
search for "Project objects" in the Project Visual Basic help file. For
your reference, there is not a "Columns" collection.

Hope this helps.
John
 
J

JackD

I agree with John. It is often easier to set the view that you want rather
than trying to figure out what is there.
What are you needing the column for? If you are using it to find specific
pieces of information for a task (like start date, duration etc.) then you
are better off taking that from the task object directly. Project is not
like excel so you rarely need to work with row and column to find/change
what you want.

for example:

activeproject.task(5).name = "This is task 5"

will set the name of the fifth task to "This is task 5"
You can do the same for the data in any of the columns (whether they are
shown in the current view or not).

-Jack
 

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