Re: An unexpected error occured with the method
- From: "Rod Gill" <rod AT project-systems DOT co DOT nz>
- Date: Thu, 22 Jun 2006 19:53:54 +1200
There is an old field called the Marked Task. I think it was created before
Flag fields were added and it has survived since then for backwards
compatibility.
A good thing about the Market Task flag is that you can have a text style
for it. So, set Marked to True then under Format, Text Styles, format how
you want a marked task to go.
Now as your VBA code marks and unmarks tasks, the format changes
automatically: no need to select tasks at all!!
--
Rod Gill
Project MVP
Visit www.msproject-systems.com for Project Companion Tools and more
"Daniel Engelschalt" <Daniel.Engelschalt@xxxxxxxxxxxxxx> wrote in message
news:1150958614.213141.282740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Jan,
What I am trying to do is to mark tasks. I think it is user friendly to
do this by changing the font color of this task. As you have written
below, font stuff only works on a selection - so I have to outline all
tasks to move to that specific task whose font I want to change. I do
this because SelectTaskField only works with row:=myTask.ID. And this
leads to selecting e. g. the 50th visible task and not the 50th task of
the whole project which I wanted to select. So first I have to outline
all tasks and then select the one I need.
But it seems that this is not the appropriate way to indicate something
to the user. Maybe a plain listbox (without being able to click on a
task and moving to it) does this job.
Thanks,
Daniel
Jan De Messemaeker schrieb:
Hi Daniel,
Matter of fact, Font only works on the selection.
Beware, you talk about background color, in any of the commercially
available versions that doesn't exist.
But where Rod definitely has a point, why select a column?
HTH
--
Jan De Messemaeker, Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
For FAQs: http://www.mvps.org/project/faqs.htm
"Daniel Engelschalt" <Daniel.Engelschalt@xxxxxxxxxxxxxx> schreef in
bericht
news:1150886679.056728.5280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Gill,visible
What is the correct way to mark a task and assign another font or
background color to indicate that something is wrong there? All
functions I have found are cursor-related. As I have written below
something like: activeproject.Tasks(currentTask.ID).font.color=1 would
be helpful.
Thanks,
Daniel
Rod Gill schrieb:
So why are you selecting the columns? If the indicator column isn't
messageyour code will crash, one of many reasons why moving the cursor in a
vba
macro is poor programming, slow and expensive to develop!!
--
Rod Gill
Project MVP
Visit www.msproject-systems.com for Project Companion Tools and more
"Daniel Engelschalt" <Daniel.Engelschalt@xxxxxxxxxxxxxx> wrote in
tonews:1150108672.907956.302130@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Gill,
Thank you for your fast response.
My function starts with:
SelectTaskColumn Column:="Indicators", Additional:=3
as the very first command.
The goal is to mark all tasks, outline and analyze them and after a
task has been analyzed mark these that match a given condition.
To mark tasks I use SelectTaskField for which I first have to
outline
all tasks (row).
A command like activeproject.Tasks(currentTask.ID).font.color=1
could
be helpful, but I haven't found something like this.
Daniel
Rod Gill wrote:
Hi,
What's the code that causes the problem? Moving the cursor to
tasks
problematicread/write data is completely unnecessary and causes slow and
outcode. For example if you try to move to a task that has been
filtered
or
to a sub-task that is not visible your code errors out.
Use:
activeproject.tasks("My Task").work=8*60
Don't move to the task then edit, it simply isn't robust!
--
Rod Gill
Project MVP
Visit www.msproject-systems.com for Project Companion Tools and
more
.
- References:
- An unexpected error occured with the method
- From: Daniel Engelschalt
- Re: An unexpected error occured with the method
- From: Rod Gill
- Re: An unexpected error occured with the method
- From: Daniel Engelschalt
- Re: An unexpected error occured with the method
- From: Rod Gill
- Re: An unexpected error occured with the method
- From: Daniel Engelschalt
- Re: An unexpected error occured with the method
- From: Jan De Messemaeker
- Re: An unexpected error occured with the method
- From: Daniel Engelschalt
- An unexpected error occured with the method
- Prev by Date: Re: An unexpected error occured with the method
- Next by Date: Project task notes
- Previous by thread: Re: An unexpected error occured with the method
- Next by thread: Automate Actual Hours from Excel
- Index(es):
Relevant Pages
|