XML stream

J

J

I have written a function (listed in full below) using the
GetProjectServerSettings method in order to return the
assigned security groups of the current user. This
function is triggered from the Project_Open event. When I
open a project from PWA, I receive the error:

"Microsoft Project cannot be fully opened because it is
awaiting your input. Either continue with the input
process until Microsoft Project is fully running or quit
Microsoft Project and click Update again."

This error only appears when opening projects from PWA
when MSP must be opened. When the tool is already open,
the function executes without problems.

Is there a known problem with this method that prevents it
from executing during the initial opening of a project
from PWA? Thanks in advance.

Public Function Get_Perm_Grp()
On Error Resume Next
'populates the global grps(20) as string array with
all assgined user permission groups

Dim url, xmlStream, Group As String
Dim x As Integer
x = 0
url = ActiveProject.ServerURL

If Application.GetProjectServerVersion(url) =
pjServerVersionInfo_P10 Then
ActiveProject.MakeServerURLTrusted
xmlStream = Application.GetProjectServerSettings( _
RequestXML:="<ProjectServerSettingsRequest>" _
& "<GroupsForCurrentProjectManager />" _
& "</ProjectServerSettingsRequest>")

Group = Mid(xmlStream, 82)
'check if group is NULL or is the end of the data
stream
Do Until Group = "" Or Right(Left(Group, InStr
(Group, "<") - 1), 1) = ">"
grps(x) = Left(Group, InStr(Group, "<") -
1) 'permission group
Group = Mid(Group, InStr(Group, "<") + 41)
x = x + 1
Loop
End If

End Function
 

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