Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

VBA Macro OutlineShowTasks Fails

$
0
0

Good afternoon all,

I'm running into a problem and am hoping you can shed some light on it for me.

I'm trying to show all tasks via VBA for a consolidated project schedule, but every time I try to run it, I receive the following error:

Run-time error '-2147417848 (80010108)':

Method 'OutlineShowTasks' of object '_MSProject' failed.

My code follows (I need to show all tasks for two schedules, hence the For-Next loop):

    For Each thisProject In Application.Projects
        thisProject.Activate
        Application.SelectAll
        
        If thisProject.Subprojects.count > 0 Then
            Application.OutlineShowTasks ExpandInsertedProjects:=True
        Else
            Application.OutlineShowAllTasks
        End If
    Next thisProject

Here's the screen shot of the error as well:

OutlineShowTasks Error

If I try to run the code from Project rather than from the VBA Editor, I receive the following error:

I'm stumped. Any suggestions?

Thanks in advance,

John


John C. Johnson


Viewing all articles
Browse latest Browse all 5347

Trending Articles