A
Ancient Brit
Hi
I have a macro that works fine (thanks to help received in the recent past
from august personages here ) - unless I run it twice in succession...
The application is Project 2003 and the project file consists of a single
project (~300 tasks) with a single embedded subproject (~100 tasks). For more
background see "How to filter for milestones *and* their predecessors?" from
12/13/2007 et seq.
The macro works as expected when run once - it identifies milestone tasks in
both project and subproject and their respective predecessors and sets a flag
accordingly for each task/subtask in a column created for the purpose. These
flagged tasks are known as "milestone-related".
If however the macro is run again, it fails with an error 1004 (unexpected
error in method - the method being Projects(variable).Activate) and the
culprit appears to be Application.Projects.Count, which shows a value that is
one more than the correct count, causing Projects(variable).Activate to fail.
If I close the file and re-open it and run the macro, everything works fine
again.
I've searched around to see if I can find anything about a possible
Application.Projects.Count bug but so far no joy.
The workaround for now is to tell the users "don't run it more than once"
but of course that's not satisfactory...
Grateful for any clues,
Peter
I have a macro that works fine (thanks to help received in the recent past
from august personages here ) - unless I run it twice in succession...
The application is Project 2003 and the project file consists of a single
project (~300 tasks) with a single embedded subproject (~100 tasks). For more
background see "How to filter for milestones *and* their predecessors?" from
12/13/2007 et seq.
The macro works as expected when run once - it identifies milestone tasks in
both project and subproject and their respective predecessors and sets a flag
accordingly for each task/subtask in a column created for the purpose. These
flagged tasks are known as "milestone-related".
If however the macro is run again, it fails with an error 1004 (unexpected
error in method - the method being Projects(variable).Activate) and the
culprit appears to be Application.Projects.Count, which shows a value that is
one more than the correct count, causing Projects(variable).Activate to fail.
If I close the file and re-open it and run the macro, everything works fine
again.
I've searched around to see if I can find anything about a possible
Application.Projects.Count bug but so far no joy.
The workaround for now is to tell the users "don't run it more than once"
but of course that's not satisfactory...
Grateful for any clues,
Peter