in the negative outcome, are you running the program in windows session 0? similarly/if that's unclear, is TM1 server running 'as a windows service'?
if yes, would it vary if you ran the server as a desktop app? (s instead of sd)
i can imagine a number of challenges if you're looking to run Office completely headless, and for your local test outcome that may be a distinct set of issues as well. There are some options regarding log in (leveraging a 'sticky' report is one), but I'd like to make sure your circumstances are good and you wouldn't just run into other issues as you proceed.
Can you email me a sample of your vbs?
------------------------------
Ted Phillips
------------------------------
Original Message:
Sent: Tue March 01, 2022 03:24 AM
From: Herman Teeuwen
Subject: Scripting PAX API with Excel application hidden
Sure I can.
I was testing report bursting via an app and noticed that when executing the bat file that triggers the app directly on the TM1 server, logged on with the service account, everything worked just fine (Excel running in interactive mode).
When kicking of the same bat file via TI process, Excel runs hidden on the TM1 server and hangs. I have to kill the task manually and after that I get a message saying that Remote procedure call failed.
On the TM1 server I applied all the suggested fixes that circulate on the internet like adding Desktop folder, DCOM settings etc., as suggested for example here.
I first thought it was maybe related to the stack I'm using (Python & xlwings), but I was able to replicate the same behavior on my workstation with vbs and Excel visible vs. hidden.
Through vbs I'm opening an xlsm with the VBA posted here on IBM page. This two-step logon is needed in case of security mode 5/CAM authentication.
I then open a PAfE report and call the VBA to logon and refresh data. This works just fine in interactive mode with Excel visible, but Excel hangs when executed hidden. After I kill Excel, I get the same message saying that Remote procedure call failed.
After that I did some further testing and I think it's related to the two logon statements.
I read on this forum about a trick to automatically logon to PAfE by integrating a hidden quick report and VBA to trigger a refresh of this quick report. When I use this and comment out the logon statements from VBA macro everything works fine whether Excel is visible or not. This is not a real word option though because service account is not a TM1 admin.
------------------------------
Herman Teeuwen
Original Message:
Sent: Mon February 28, 2022 10:00 AM
From: Ted Phillips
Subject: Scripting PAX API with Excel application hidden
In general, I would say it should work. Perhaps you can share additional details?
------------------------------
Ted Phillips
Original Message:
Sent: Fri February 25, 2022 06:10 AM
From: Herman Teeuwen
Subject: Scripting PAX API with Excel application hidden
Hi,
Does anybody know if it's possible to script through PAX api with Excel Application hidden?
When executed with Excel visible everything works just fine, but with Excel hidden, script hangs and Excel has to be killed. I'm getting errors saying that remote procedure call failed.
Best regards,
Herman
------------------------------
Herman Teeuwen
------------------------------
#PlanningAnalyticswithWatson