[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Export Project Tasks assigned to a single individual

Posted on 2010-08-17
8
Medium Priority
?
638 Views
Last Modified: 2012-05-10
I want to export the tasks assigned to a single individual to a separate Excel file.  Out of my very large project, I want to filter on the tasks assigned to an individual and then Export ONLY those tasks shown by the filter to an Excel file.

I already have my export map saved, but none of the filters in the Save map allow me to filter by tasks assigned to a single resource name.

How do I do this?  (preferably how do I do it in code...but I can record a macro if shown how to do it in the GUI)
0
Comment
Question by:rgautier
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 10

Assisted Solution

by:SANTABABY
SANTABABY earned 1000 total points
ID: 33460341
Have you tried creating a filter for your specific resource:
Resource Names          equals                <........>

and selected that filter in the export wizard?

-- Another approach is to use VBA to copy the required task attributes to a spreadsheet for a specified individual. (I have some samples, let me know if you need it).
0
 
LVL 12

Accepted Solution

by:
Dr. Thomas Henkelmann earned 1000 total points
ID: 33462702
Hi,

in the export map you can select all task filters as in a gantt chart view. So why don't you just use the "Using resource" filter? When you finally save the Excel file based on this map you are being asked for the resource name you want to filter to.

Regards

Thomas
0
 
LVL 13

Author Comment

by:rgautier
ID: 33463689
What I need is while I am in VBA to basically do in a For loop -

Dim r as Resource
For r in ActiveProject.Resources
    :code I don't know here:
next r

Where that code does a SaveAs to Excel, after setting the filter to be the selected resource and the filename is a string based on the resource name.

thausla: I looked through the selectable filters in the map - none were by resource.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 13

Author Comment

by:rgautier
ID: 33464210
For example:

I tried recording a macro doing this, and it recorded only this entry:

FileSaveAs Name:="C:\Users\rich gautier\Desktop\myproject_myresource.xlsx", FormatID:="MSProject.ACE", map:="IMS_Export_Map"

Note that this line of code does NOT show me selecting the resourcename from the popup box during the save - which is the part that I need to automate.
0
 
LVL 13

Author Comment

by:rgautier
ID: 33464283
Here is the closest I've gotten so far:
    Dim r As Resource
    Dim fn As String
    For Each r In ActiveProject.Resources
      MsgBox r.Name
      fn = "C:\Users\rich gautier\Desktop\MyProject_" & r.Name & ".xlsx"
      FileSaveAs Name:=fn, FormatID:="MSProject.ACE", map:="IMS_Export_Map"
    Next r

What this code does, though is display which Resource name to select in the upcoming selection box - and then I type it, or select it from the box....  I need some way for it to automatically select that resource name during the export(FileSaveAs) function.
0
 
LVL 13

Author Comment

by:rgautier
ID: 33465167
Ok -  this did it for me:

//See attached code block

I used SendKeys to pad the keyboard buffer with the answer to the popup message (I know that I'm playing with fire with this)

If someone has a better solution, please let me know.  As thausla suggested, I did use the filter 'Using resource' - which I had not seen previously.

I'd also love to see SantaBaby's VB examples if he comes back....so I'll leave this question open for a bit.



Sub SavewithFilter()
' Macro SavewithFilter
' Macro Recorded Wed 8/18/10 by rich gautier.
    Dim r As Resource
    Dim fn As String
    Dim KeyBuf As String
    
    For Each r In ActiveProject.Resources
      KeyBuf = r.Name & Chr(13)
      fn = "C:\Users\rich gautier\Desktop\Exports\MyProject_" & r.Name & ".xlsx"
      SendKeys KeyBuf
      FileSaveAs Name:=fn, FormatID:="MSProject.ACE", map:="IMS_Export_Map"
    Next r
    
End Sub

Open in new window

0
 
LVL 10

Assisted Solution

by:SANTABABY
SANTABABY earned 1000 total points
ID: 33468569
I was thinking about a brut force approach to open an Excel app and populate it using project VBA, something like the following:

Private Sub ExportTaskForIndividual(Optional RscName As String = "")

    Dim T As Task
    Dim TaskAsn As Assignment
   
   
    For Each T In ActiveProject.Tasks
         For Each TaskAsn In T.Assignments
            If RscName = "" Or TaskAsn.ResourceName = RscName Then
                'write a VBA function to add a record to an excel workkbook in the
                'resource specific worksheet
                'AddAssignment(workbookname,sheetname,assignment)
                'AddAssignment('<workbook Name>",RscName & "_tasks",TaskAsn)
            End If
        Next TaskAsn
    Next T
   

End Sub
0
 
LVL 13

Author Closing Comment

by:rgautier
ID: 33474261
I was looking for a quick and simple solution to how to access the export functionality with VBA code that would auto-answer the asked questions or export with a filter than could be auto-configured in code.

While technically correct that I could use VBA code to manually export my data, I would have to recode the solution every time my template changed, which is not a good alternative.

I thank the experts for their inputs and awarded points  for both helping me get to my solution and providing alternatives.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabilā€¦
Introduction to Processes

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question