Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS Project 98/2000 and Visual Basic 6.0

4 views
Skip to first unread message

Linda Huson

unread,
May 1, 2003, 3:10:10 PM5/1/03
to
I am trying to determine the tasks count from a Project
file (immediately after opening it) with the following
instruction:
Set msProj = CreateObject("MSProject.Project")
iTask = msProj.Application.ActiveProject.Tasks.Count

A problem occurred when opening an MS Project 98 file from
within a Visual Basic script that opened the file in
Project 2000 - the Tasks object was not defined and
resulted in an error:
msProj.Application.ActiveProject.Tasks -> **ERROR**
((10091) ActiveX Automation: no such property or method.)

HOWEVER, this instruction works on some MS Project 98
files. I am looking for a definition of the Tasks
Collection Object and why it might not exist in a MS
Project 98 file.
We've spent a lot of time on this problem - any help would
really be appreciated!!! Thanks

Rod Gill

unread,
May 1, 2003, 3:29:42 PM5/1/03
to
Hi,

The most obvious problem is that your reference is wrong. msProj is already
and application object as defined by the createobject code. Try:
Dim iTask as Integer
iTask = msProj.ActiveProject.Tasks.Count


--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
"Linda Huson" <linda....@baesystems.com> wrote in message
news:00d001c31015$49382600$a501...@phx.gbl...

Jan De Messemaeker

unread,
May 2, 2003, 3:50:32 AM5/2/03
to
Hi,

There *may* be another problem.
VBA when run from Project 2000 has problems opening files that were created
in Project 2000 and later saved as Project98.
If this is the case, make people save as P 2000 again.
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
Project Management Consultancy
Prom+ade BVBA
32-495-300 620
"Rod Gill" <rodg at project-systems dot co dot nz> schreef in bericht
news:#kBJFgBE...@TK2MSFTNGP11.phx.gbl...

0 new messages