Consulting

Results 1 to 4 of 4

Thread: Solved: Pulling Data From MS Project Into Excel

  1. #1

    Solved: Pulling Data From MS Project Into Excel

    hi all - has anyone had any experience interfacing Excel & MS Project?

    I'm trying to create a report, that will pull resource data into excel from MS Project.. i've found some sample vba code that spits data out of project to excel, but only when you're in / using ms project - and then it dumps it into a new worksheet.

    But the whole thing's 'the wrong way round', and no amount of tweaking seems to make it work. (we've had 3 of us crowded round a screen, offering ideas on this one!)

    In base terms, what i need to do is this :-

    a) prompt users to 'browse' for the relevant project .mmp file
    b) pull out of the file, all the 'resource used' data from the .mmp (without opening)
    c) drop all data found (in plain text) into a new worksheet for further processing

    has anyone got any ideas / seen examples / ever done this??

    there seems to be relatively little info available about mixing excel & project....

    Tia

    Russ


  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Not sure if this would help you or not but here is some code courtesy of C Pearson that reads tables in MS Project from Excel:

    [VBA]
    Dim MSProj As MSProject.Application
    Sub CopyTasksToExcel()
    Dim Tsk As MSProject.Task
    Dim DestCell As Range

    If MSProj Is Nothing Then
    Set MSProj = New MSProject.Application
    End If

    MSProj.FileOpen Name:="c:\Test\Test1.mpp"
    Set DestCell = Range("A1")
    For Each Tsk In MSProj.ActiveProject.Tasks
    DestCell.Value = Tsk.Name
    Set DestCell = DestCell(2, 1)
    Next Tsk

    End Sub
    [/VBA]

    Also another option might be:

    in Project 2002 onwards you can save a project as a .xml file, or
    in any version you can save to .mdb or any odbc database. You could then
    read data directly from it.


    HTH

  3. #3
    cool! that kinda works! thanks for the baseline to work from!


  4. #4
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Glad it worked for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •