When we are using the following cod to sso lgoin in office 2016 64bit. It got login failed when first try. But it can login successfully once click the button again. Would you please advise?
Private Sub CommandButtonLogonSSO_Click()
On Error GoTo HANDLER:
Dim oMessageSuppressor As CognosOfficeMessageSuppressor
'Use the message suppressor to turn off all Cognos Office messages.
Set oMessageSuppressor = New CognosOfficeMessageSuppressorApplication.Cursor = xlWaitDim server As String
bSuccess = Reporting.LogonSSO(server, "SDataHierarchy", True, "negotiate")
Application.Cursor = xlDefault
If (bSuccess) Then
MsgBox "Successfully connected to " + server, vbInformation
Reporting.TaskPane.Show
Reporting.TaskPane.Refresh
Call Reporting.TaskPane.ChangeDataSource(server, "SDataHierarchy")
Else
Call MsgBox("Error connecting to " + server, vbExclamation)
End If
------------------------------
Dick Ma
------------------------------