Gantt: Get line and column of current cell.

E

Emmanuel

Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is empty. At
the moment, there is error. It's not a problem but I use trap error system.
My problem is how get the line the task if don't exist... I use to get line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row) the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
J

Jim Aksel

Is there a way to get a line of the current cell without taskID? You may want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 
J

Jan De Messemaeker

Sorry to intervene here.
When tsk is nothing tsk.ID will give an error
so by definition you cannot test tsk.ID is nothing
HTH

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Jim Aksel said:
Is there a way to get a line of the current cell without taskID? You may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



Emmanuel said:
Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is empty.
At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row) the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
E

Emmanuel

Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




Jim Aksel said:
Is there a way to get a line of the current cell without taskID? You may want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



Emmanuel said:
Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is empty. At
the moment, there is error. It's not a problem but I use trap error system.
My problem is how get the line the task if don't exist... I use to get line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row) the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
E

Emmanuel

Yes Jan.
See you soon,
Emmanuel.

Jan De Messemaeker said:
Sorry to intervene here.
When tsk is nothing tsk.ID will give an error
so by definition you cannot test tsk.ID is nothing
HTH

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Jim Aksel said:
Is there a way to get a line of the current cell without taskID? You may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



Emmanuel said:
Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is empty.
At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row) the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
J

Jan De Messemaeker

Bonjour Emmanuel

(Pusiqu'on est dans le groupe en Anglais je continue dans cette langue)

If there is only one cell selected this may work in most circumstances (not
if the empty task is the final one, I have to think about that):

If activeselection.tasks(1) is nothing then
selectcelldown
TheID=activeselection.tasks(1).ID-1
end if

Hope this helps,

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Emmanuel said:
Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I
get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




Jim Aksel said:
Is there a way to get a line of the current cell without taskID? You may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



Emmanuel said:
Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is
empty. At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row)
the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
E

Emmanuel

(Oui je comprends pour la langue)

Why do you write this:
TheID=activeselection.tasks(1).ID-1
It seems a mystake if SelectCellDown:
It's not ID-1 but ID+1, no ?
Or I don't understand the idea.

You confirm the simple function to get line of activecell don't existe ?

Emmanuel.

Jan De Messemaeker said:
Bonjour Emmanuel

(Pusiqu'on est dans le groupe en Anglais je continue dans cette langue)

If there is only one cell selected this may work in most circumstances (not
if the empty task is the final one, I have to think about that):

If activeselection.tasks(1) is nothing then
selectcelldown
TheID=activeselection.tasks(1).ID-1
end if

Hope this helps,

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Emmanuel said:
Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I
get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




Jim Aksel said:
Is there a way to get a line of the current cell without taskID? You may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



:

Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is
empty. At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the row)
the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
J

Jack Dahlgren

Emmanuel,

Project is different from Excel. The activecell has very little meaning. The
cells in the table are just used to display information, not to hold
information. This is why activecell does not have the same set of methods as
Excel. The data is stored in project by task, so Project VBA works best on
task, resource and assignment objects instead of cells and rows. Once you
understand that, then the fact that there is no function to get the line of
an empty active cell is not a surprise. The line you are accessing has no
task associated with it. So you can not get any information about it
directly.

A blank line in project is like a space between words in a sentence. It has
almost no meaning and exists only to make something easier to read.

-Jack Dahlgren

Emmanuel said:
(Oui je comprends pour la langue)

Why do you write this:
TheID=activeselection.tasks(1).ID-1
It seems a mystake if SelectCellDown:
It's not ID-1 but ID+1, no ?
Or I don't understand the idea.

You confirm the simple function to get line of activecell don't existe ?

Emmanuel.

Jan De Messemaeker said:
Bonjour Emmanuel

(Pusiqu'on est dans le groupe en Anglais je continue dans cette langue)

If there is only one cell selected this may work in most circumstances
(not
if the empty task is the final one, I have to think about that):

If activeselection.tasks(1) is nothing then
selectcelldown
TheID=activeselection.tasks(1).ID-1
end if

Hope this helps,

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Emmanuel said:
Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I
get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups
you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the
line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




:

Is there a way to get a line of the current cell without taskID? You
may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the
USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



:

Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is
empty. At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to
get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the
row)
the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
J

Jan De Messemaeker

Hi,

Yes since an empty line is Nothoing and does not have any property
If I go down the ID I get is one higher so I have to substrat one.

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Emmanuel said:
(Oui je comprends pour la langue)

Why do you write this:
TheID=activeselection.tasks(1).ID-1
It seems a mystake if SelectCellDown:
It's not ID-1 but ID+1, no ?
Or I don't understand the idea.

You confirm the simple function to get line of activecell don't existe ?

Emmanuel.

Jan De Messemaeker said:
Bonjour Emmanuel

(Pusiqu'on est dans le groupe en Anglais je continue dans cette langue)

If there is only one cell selected this may work in most circumstances
(not
if the empty task is the final one, I have to think about that):

If activeselection.tasks(1) is nothing then
selectcelldown
TheID=activeselection.tasks(1).ID-1
end if

Hope this helps,

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Emmanuel said:
Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I
get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups
you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the
line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




:

Is there a way to get a line of the current cell without taskID? You
may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the
USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



:

Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is
empty. At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to
get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the
row)
the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 
E

Emmanuel

Okay Jack, I understand the concept cell project...
It's a shame...
Tanhk you for all responses,
Emmanuel REGIS.

Jack Dahlgren said:
Emmanuel,

Project is different from Excel. The activecell has very little meaning. The
cells in the table are just used to display information, not to hold
information. This is why activecell does not have the same set of methods as
Excel. The data is stored in project by task, so Project VBA works best on
task, resource and assignment objects instead of cells and rows. Once you
understand that, then the fact that there is no function to get the line of
an empty active cell is not a surprise. The line you are accessing has no
task associated with it. So you can not get any information about it
directly.

A blank line in project is like a space between words in a sentence. It has
almost no meaning and exists only to make something easier to read.

-Jack Dahlgren

Emmanuel said:
(Oui je comprends pour la langue)

Why do you write this:
TheID=activeselection.tasks(1).ID-1
It seems a mystake if SelectCellDown:
It's not ID-1 but ID+1, no ?
Or I don't understand the idea.

You confirm the simple function to get line of activecell don't existe ?

Emmanuel.

Jan De Messemaeker said:
Bonjour Emmanuel

(Pusiqu'on est dans le groupe en Anglais je continue dans cette langue)

If there is only one cell selected this may work in most circumstances
(not
if the empty task is the final one, I have to think about that):

If activeselection.tasks(1) is nothing then
selectcelldown
TheID=activeselection.tasks(1).ID-1
end if

Hope this helps,

--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
Jim thank you for your response and your response of my bad english ;o)

Your solutions are okay, but my problem is to get the line same if
ActiveCell.Task don't exist... Do you understand my problem... How do I
get
the line when Task don't exist ?
In French newsgroups, no body have the solution but in US newsgroups
you
have perhaps the solution...

Example tasks in Gantt diagram:
ID---Task name-----Delay
1 T1 1d
2 [ ]
3 T2 1d

At the moment, when the user is at [ ] (current cell), the task don't
exist then I can't get the lin by ActiveCell.Task.ID...

It's strange that Microsoft don't create a SIMPLE function to get the
line
(and the row) of active (current) cell.

What do you think ?

See you soon,
Emmanuel.




:

Is there a way to get a line of the current cell without taskID? You
may
want
to use [UniqueID] but that will not tell you a row number.

To avoid an error on a blank line, test for it.

Dim tsk as Task
if not tsk is nothing then
'your code here
end if

or
if not ActiveCell.Task.ID is nothing....


Your English is good enough... better than some who live here in the
USA.
--
If this post was helpful, please consider rating it.

Jim
It''s software; it''s not allowed to win.

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



:

Hi,

Excuse me for my bad english...

On Gantt diagram:
So, I want get the line and culumn of current cell: Type by user.
I use this function: SelectTaskField Row:=ActiveCell.Task.ID,
ActiveCell.FieldName, RowRelative:=False .
But the problem is if the task don't exist then ActiveCell.Task is
empty. At
the moment, there is error. It's not a problem but I use trap error
system.
My problem is how get the line the task if don't exist... I use to
get
line:
ActiveCell.Task.ID.

Could you tell me if exist other method to get the line (end the
row)
the
current cell without use the Task.ID for line ?

Thank you,
Emmanuel REGIS (France / Lyon).
 

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