Background FontEx CellColor function?

S

SpaceCamel

I am using the FontEx function to highlight rows with certain properties.

The macro loops thru all tasks and if there is a match it then uses
SelectRow to select the task and apply the CellColor.

But SelectRow doesn't give the right row if there are rolled-up summaries.

Is there a way to use the FontEx function in the background, just using the
task object?
 
J

John

SpaceCamel said:
I am using the FontEx function to highlight rows with certain properties.

The macro loops thru all tasks and if there is a match it then uses
SelectRow to select the task and apply the CellColor.

But SelectRow doesn't give the right row if there are rolled-up summaries.

Is there a way to use the FontEx function in the background, just using the
task object?

SpaceCamel,
The FontEx Method was added in Project 2007 supposedly to pick up
Project 2007's ability to color cell backgrounds. However, apparently
the "cake is only half baked" since the cellcolor and pattern variables
are not yet available. Interesting.

Unfortunately, the FontEx method acts on the active cell, like a few
other methods in Project. That means the desired cell must be visible to
be activated (i.e. no background processing).

I suggest you do the following. At the beginning of your code, save the
active view. Then expand the whole file before running the part that
sets the font characteristics. At the end of your code re-store the
saved view. I use this same process in all my macros that require some
part of the code to do foreground processing.

John
Project MVP
 
S

SpaceCamel

John,

I tried but the original view is not restoring. It remains expanded. What
am I doing wrong?.

I am saveing the current view with:
currView = myProj.CurrentView

then restore with:
myProj.Views(currView).Apply

-------------------------------------------------
 
J

John

SpaceCamel said:
John,

I tried but the original view is not restoring. It remains expanded. What
am I doing wrong?.

I am saveing the current view with:
currView = myProj.CurrentView

then restore with:
myProj.Views(currView).Apply

SpaceCamel,
Oops, you're right, expanding or collapsing a view is not a process that
is captured when the current view is saved. I normally work with
filtered sets of data and the process I described does work in that case.

There is a way to recreate the original view display using OutllineHide
but that requires a rather complex algorithm to set up. You'd basically
have to detect the sequence of IDs and then hide tasks as necessary to
recreate the original view display. It can be done, but unless you like
a challenge, it's not worth it.

What you can do is the following. Go ahead and expand the file to set up
the font characterisctics. If what you are doing is for display
presentation only and you don't need to keep the changes, just close the
file when you done without saving. When the re-open the file it will be
in its original collapsed form. If you do need to save the font changes,
go ahead and manually collapse the summary lines as necessary and save
the file.

Sorry for the slight misdirection.

John
Project MVP
 

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