CAFE VBA/VBS automation - cannot log in to TM1 server

Post Reply
daniel.havassy
Posts: 30
Joined: Wed Sep 14, 2016 9:26 am
OLAP Product: Planning Analytics Local
Version: 2.0.4
Excel Version: 2016

CAFE VBA/VBS automation - cannot log in to TM1 server

Post by daniel.havassy »

Hi Everyone,

I'd like to ask for some help regarding a CAFE VB automation issue.

What I'm trying to accomplish: After a data load, automatically refresh a CAFE Excel worksheet (it has two FlexViews) which I use for a post-load data quality check. I'd like to achieve this by executing a VB script file from the TI Epilog.

Issue: Logging in to the TM1 server from the script doesn't work, and so no further function is executed properly, although the Logon function returns True.

Further details: TM1 and CAFE 10.2.2. I have set up the CAFE automation using the samples in the CAFE installation directory's Automation folder.

Check below the relevant part of the code that I use. Any help is much appreciated.

Code: Select all

Set objWB = objExcel.Workbooks.Open("C:\some path\someFile.xlsm")

objWB.Activate

bSuccess = objExcel.Run("Logon", "http://server/ibmcognos/cgi-bin/cognos.cgi", "user", "pwd", "namespace")

If (bSuccess) Then

    objExcel.Run "ClearAllData"

    objExcel.Run "RefreshAllData"

    objExcel.Run "Logoff"

    objWB.Save

End If
Post Reply