Setting Workgroup To None with Macro

F

FaisalM

I've been working on a scenario where I need to set workgroup setting for
inactive resrouces to NONE in project plans.

I was able to create a macro to set the workgroup to none for first inactive
resrouce in a plan & fill that value out to other inactive users in that
plan. But that macro doesn't work on other plans as the number of inactive
enterprise resoruces in each plan could be different.

Can someone make this work?

I'm not an very good at macros, but here the code.


Sub FMTest10()
ViewApply Name:="*Resource &Sheet"
SelectResourceColumn Column:="Type"
TableEdit Name:="&Entry", TaskTable:=False, NewName:="", FieldName:="",
NewFieldName:="Inactive", Title:="", Width:=10, Align:=2, ShowInMenu:=True,
LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, ColumnPosition:=2,
AlignTitle:=1
TableApply Name:="&Entry"
SelectResourceColumn Column:="Type"
TableEdit Name:="&Entry", TaskTable:=False, NewName:="", FieldName:="",
NewFieldName:="Workgroup", Title:="", Width:=10, Align:=2, ShowInMenu:=True,
LockFirstColumn:=True, DateFormat:=255, RowHeight:=1, ColumnPosition:=3,
AlignTitle:=1
TableApply Name:="&Entry"
SetResourceField Field:="Workgroup", Value:="None"
SelectResourceField Row:=0, Column:="Workgroup"
FillDown
End Sub



--
FaisalM
http://www.FaisalMasood.com/

My Project Blog
http://msp.faisalmasood.com/
My Sharepoint Blog
http://sps.faisalmasood.com/
 
D

Dale Howard [MVP]

FaisalM --

You made this way too hard. To use the following code, first open the
Enterprise Resource Pool and check out all resources, including your
Inactive resources, and then run the code. Here's the code:

Sub SetInactiveToWorkgroupNone()

Dim r As Resource

For Each r In ActiveProject.Resources

If r.EnterpriseInactive = True Then

r.Workgroup = pjNoWorkgroupMessages

End If

Next r

End Sub

Hope this helps.
 
F

FaisalM

Thanks Dale for your response.

Let me give you more info on the issue.

I wanted to automate the resolution of 0x8C040017 spooler error. I've few
things to try. The first thing was to use macro they can use which
autmatically do the steps. Keep in mind that we don't want to set workgroup
to NON for active users in the project plan.

a. We don't allow automatic account creation through MS Project Professional.
b. After some time the IT deletes the Active directory accounts of users who
left the company. (I'm assuming MSPS gives the spooler error as it doesn't
find the the domain\acount information in the domain as listed in the
inactive resources' properties.)
c. We have inactive resources in most of the projects. We don't remove
inactive users as the business wants to keep the historical data.

Now on some projects, PMs get spooler error 0x8C040017. To get the issue
fixed, PM has to undo the action in spooler window, change the workgroup
setting of inactive resources to NONE in that plan & then publish the plan.
That works just for that time. They have to redo all these steps if they
close hte plan.

Reference: http://www.projectserverexperts.com/Shared
Documents/CannotCreateAccount.htm

When PM changes workgroup for the first inactive user to NONE, MSPS displays
a popup message saying:


"Change to enterprise resource will be lost.

You can modify an enterprise resoruce in a project for modelling purposes
and publishing a project will include any changes. Your changes will be
overwritten when the project is next opened.

A user with security permissions can modify the attributes of this resource
by checking out the resources with the open Enterprise Resource Pool command."

They click Ok to get pass that message.

The second option I tried is this.
I checked out all inactive resources using Resource Center filters. set the
workgroup to NONE & saved it. After a while went back to the project & those
inactive users still have Default as the workgroup type. Also I got the
0x8C040017 spooler error when I published it. The Entp Res Pool still shows
NONE. That means this resolution option didn't work.

Now back to first option of using some macro to do the steps. If error
handling is not possible, then we are ok at least to ask the PMs to run the
macro if they get 0x8C040017 spooler error.

Do you have a permanent resolution / better way around for this spooler error?

Thanks in advance.

--
FaisalM
http://www.FaisalMasood.com/

My Project Blog
http://msp.faisalmasood.com/
My Sharepoint Blog
http://sps.faisalmasood.com/
 
D

Dale Howard [MVP]

Faisal --

I found with this issue at a client site, and I can confirm what you say
about EVERY step in the process. I was UNABLE to resolve the issue and
found absolutely no documentation in the Microsoft KB about this ongoing
problem. It has been extremely frustrating for this client's PM's and their
administrators, and was frustrating for me since none of the steps I did
actually worked, just the way you have tried. Perhaps the solution is to
give your PM's the macro and have them run it every time they open a project
containing Inactive resources with Actual Work. Hope this helps.
 
D

Dale Howard [MVP]

Faisal --

You copied the macro exactly as written, I presume. It works fine for me in
a project, so I can't say what it won't work for you. Perhaps Rod or Jan
could take a look at the code and see if I overlooked something. Why don't
you post a new message with the code and see if one of them can troubleshoot
it? Sorry I can't be more help. I'm no better than a hacker with VBA code,
which folks like Rod and Jan are true professionals. :)
 
D

Dale Howard [MVP]

FaisalM --

That is WAY TOO COOL! Believe me, I couldn't figure out how it couldn't
work if I wrote it correctly. I'm happy for you, my friend (and your PM's
as well)!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top