Error 424: object required on Projects(i).property


T

tbone

I get an error 424 (object required) on the second line below:

For i = 1 To Projects.Count ' for each *loaded* project, right?
x = Projects(i).FullName ' err 424 on one of the three
If x = spjn Then Exit For
Next i

Projects.Count is 3, and I can see three windows, one for each
project. Yet one of the three is...um, not really there? A mirage?

I can trap and ignore the error, but I'd like to understand what's
going on so I can handle it more intelligently.

thx
tbone
 
Ad

Advertisements

J

Jack Dahlgren MVP

What if you just use Projects(I).Name?
FullName refers to unsaved projects.

-Jack
 
T

tbone

This gets stranger. I have a toolbar button call a macro to update all
the subproject lines in the current Master project with the Project
Summary Task info in the respective subproject files.

In order to obtain this information, it seemed I had to actually Load
each subproject file, which I added to the code. This works (but
clutters up the display, of course).

If I then Close all the subprojects, and run the update macro again,
it somehow now can access all the subproject info without reloading
all the files. But only the Master project file is loaded.

I obviously don't have a firm grasp on how Project manages the links
between the Master project and the subprojects. If I could change the
macro to avoid having to Load a subproject in order to fetch its
Project Summary Task data, that would be great. Can someone give me
some pointers?

thanks
tbone
 
T

tbone

oh, and I forgot to mention - Projects.Count stays at 7 even after I
close the 6 subprojects that were loaded and only the Master project
is still visible.

tbone
 
Ad

Advertisements

T

tbone

The fog is clearing. I've discovered the relationship between Projects
and Windows.

Still experimenting...

tbone
 

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