I am trying to iterate through the Resource Graph view one resource at a time and export to XPS with the appropriate name associated with the file. Here is the code:
Sub ResourcGraph()
' Macro Macro4
' Macro Recorded Tue 6/9/15 by Valencia, Jonathan.
Dim Res As Resource
ViewApply "Resource Graph"
SelectBeginning
For Each Res In ActiveProject.Resources
If Not Res Is Nothing Then
DocumentExport FileName:=Res.Name & "Graph", FileType:=pjXPS
End If
SelectCellRight
Next Res
End Sub
This code iterates just fine. The problem I am having is getting the name correct.The file is being named by resource but when I click on the file it is the wrong Resource. Is there a way to pull the active resource's information from the Resource Graph view, rather then just going through the resources like I have now?
This is likely due to the Resource Graph being in a different sort order than the resources in the Resource collection. Instead of trying to sync those up, you can use the Find command to move the graph to the correct resource.