Answered by:
Edit Enterprise Resources Using VBA

Question
-
Is it possible to check-out enterprise resources from the enterprise resource pool from Project Server 2010 using VBA?
Friday, November 5, 2010 8:19 PM
Answers
-
Yes. This code will open the resource with ID of 3 and set their initials to FOO, then close and check in the resource.
sub openPool()
EnterpriseResourcesOpen EUID:=3, OpenType:=pjReadWrite
For Each Resource in ActiveProject Resources
Resource.Intials = "FOO"
Next Resource
DisplayAlerts = False
FileClose
DisplayAlerts = True
End Sub
Jack Dahlgren blogs at:
Project and Retrovention
and rarely Twitter- Proposed as answer by Jack Dahlgren MVP Friday, November 5, 2010 10:04 PM
- Marked as answer by Christophe FiessingerMicrosoft employee Sunday, November 7, 2010 5:11 PM
Friday, November 5, 2010 10:04 PM
All replies
-
Yes. This code will open the resource with ID of 3 and set their initials to FOO, then close and check in the resource.
sub openPool()
EnterpriseResourcesOpen EUID:=3, OpenType:=pjReadWrite
For Each Resource in ActiveProject Resources
Resource.Intials = "FOO"
Next Resource
DisplayAlerts = False
FileClose
DisplayAlerts = True
End Sub
Jack Dahlgren blogs at:
Project and Retrovention
and rarely Twitter- Proposed as answer by Jack Dahlgren MVP Friday, November 5, 2010 10:04 PM
- Marked as answer by Christophe FiessingerMicrosoft employee Sunday, November 7, 2010 5:11 PM
Friday, November 5, 2010 10:04 PM -
Jack, Thanks. This worked perfectly. Quick question - is there a way to tie VBA to my managed code? I have a windows service I'd like to tie this to.Sunday, November 7, 2010 3:12 PM
-
Jack,
The openPool() code (above) makes the change for one user (EUID:=3). How would the code change if you wanted to make the change for all users?
I have messed with this a bit and cannot seem to get the syntax correct.
We have had recurring incidents lately where Project Server's sync to A/D fails--and inactivates a large number of users. I just want a simple VBA fix where I can quickly reset all users to "Active". That's where I'm headed with this.
Thanks,
Ed
Tuesday, March 22, 2011 5:59 PM -
Edward,
I'm not sure how to work with all resources in VBA but in C# you can get all necessary resource IDs using web service and then use EnterpriseResourcesOpen(resIDs) function. Where resIDs is a string with semicolumn-separated IDs, e.g. "1;2;3" (although the documentation says that comma-separated values should be used).
Regards,
Alexander
Friday, May 20, 2011 12:29 PM