Is there anyway to connect to a server that uses CAM authentication in VBA using the TM1 API?
I've tried the following code based on the answer found here:
SystemServerCAMSecurityRequired error when authenticating using Cognos
Dim credentials(1 To 3) As Long
credentials(1) = TM1ValString(hPool, Trim(CAMNamespace), 0)
credentials(2) = TM1ValString(hPool, Trim(ClientName), 0)
credentials(3) = TM1ValString(hPool, Trim(ClientPassword), 0)
vCredentials = TM1ValArray(hPool, credentials, 3)
hServer = TM1SystemServerConnectWithCAMNamespace(hPool, vServerName, vCredentials)
However, this causes Excel to crash.
I know I'm connecting to the correct server and I know the usernames / passwords are correct, I know that the TM1 API is installed correctly on my computer as well.
I've come up with this solution based on dialog between IBM customer support and I.
It requires you add the following declare function:
The login code: