Re: An unexpected error occured with the method



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,

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
visible
your 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
message
news: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
to
read/write data is completely unnecessary and causes slow and
problematic
code. For example if you try to move to a task that has been
filtered
out
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





.



Relevant Pages

  • Re: An unexpected error occured with the method
    ... Font only works on the selection. ... Beware, you talk about background color, in any of the commercially ... Rod Gill schrieb: ... The goal is to mark all tasks, outline and analyze them and after a ...
    (microsoft.public.project.vba)
  • Re: An unexpected error occured with the method
    ... What I am trying to do is to mark tasks. ... do this by changing the font color of this task. ... Font only works on the selection. ... Rod Gill schrieb: ...
    (microsoft.public.project.vba)
  • Re: Datagrid multiple row selections
    ... Dear Mark ... I wish there was a way to copy an entire record into another recordset, ... > alter the recordset for the grid with selected rows. ... > is use that selection to change other grids, ...
    (microsoft.public.vb.database.ado)
  • Re: Canadian Test ICP.exe
    ... can appear wherever the receiver is tuned ... The correct selection is stored in the parentheses and refers to the line ... A free Hex editor is XVI32 at ... Block Mark and Copy functions to paste the selected data into a new file ...
    (rec.radio.shortwave)
  • Re: Check Mark Symbol
    ... Monotype Sorts font type installed" in order to get a check mark. ... "Andre Da Costa" wrote in message ...
    (microsoft.public.word.drawing.graphics)

Quantcast