IBM PAFE Operations Batch Scripts

Ideas and tips for enhancing your TM1 application
Post Reply
Adam
Posts: 94
Joined: Wed Apr 03, 2019 12:10 am
OLAP Product: IBM PA
Version: 2.0.9.x
Excel Version: Microsoft 365 x64

IBM PAFE Operations Batch Scripts

Post by Adam »

Here are some useful batch scripts for IBM Planning Analytics for Excel (PAFE) Operations.

Can use this as baseline to automate install / setup / deployment / configuration of IBM PAFE to end users. If you don't want to run in Windows Command Prompt or Batch file, you can review the below and navigate directly to the appropriate registry keys or directories and adjust manually.

Feel free to add to the list, use in your deployments or troubleshooting.

Updates to this post:
  • 2023-03-10: Unlink PAFE add-ins from Excel section is also useful to fix stubborn Run-time error '91': Object variable or With block variable not set caused by Set m_oCOAutomation = Application.COMAddIns("CognosOffice12.Connect").Object.AutomationServer (the PAFE / PAX API standard reference)
Force close both Excel and PAFE:

Code: Select all

taskkill /f /im excel.exe
taskkill /f /im CognosSessionMonitor.exe
Disable ALL add-ins from Excel startup:
Assumes PAFE is one of these, and works up to 10 add-ins.

Code: Select all

REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN1 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN2 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN3 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN4 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN5 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN6 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN7 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN8 /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v OPEN9 /f
Unlink PAFE add-ins from Excel:

Code: Select all

REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\Addins\CognosOffice12.Connect" /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\Addins\CognosOffice12.ConnectPAfEAddin" /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\Addins\IBM Planning Analytics for Excel Addin (Custom Task Pane Helper)" /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\AddinsData\CognosOffice12.Connect" /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\AddinsData\CognosOffice12.ConnectPAfEAddin" /f
REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\AddinsData\IBM Planning Analytics for Excel Addin (Custom Task Pane Helper)" /f
Reset all PAFE settings:

Code: Select all

rmdir "%APPDATA%\..\Local\Cognos\" /q /s
Set Excel Option > Optimize for compatability

Code: Select all

REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v "RenderForMonitorDpi" /t "REG_DWORD" /d "0" /f
Set Excel trusted location for location of PAFE.xll file

Code: Select all

:: Needed only for network locations:
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations" /v "AllowNetworkLocations" /t "REG_DWORD" /d "1" /f

:: How to set actual trusted location:
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location999" /v "AllowSubfolders" /t "REG_DWORD" /d "1" /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location999" /v "Date" /t "REG_SZ" /d "1/1/2020" /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location999" /v "Description" /t "REG_SZ" /d "description_goes_here" /f
REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location999" /v "Path" /t "REG_SZ" /d "path_goes_here\" /f
Connect Excel to IBM PAFE Add-In:

Code: Select all

REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options" /v "OPEN" /t "REG_SZ" /d "/R path_goes_here /f
Last edited by Adam on Sat Mar 11, 2023 2:26 am, edited 1 time in total.
Take care.
Adam
User avatar
gtonkin
MVP
Posts: 1192
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: IBM PAFE Operations Batch Scripts

Post by gtonkin »

Thanks Adam - will be really useful for some IT departments who want to push new versions from time to time.
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: IBM PAFE Operations Batch Scripts

Post by Wim Gielis »

This should be part of the Useful tips and tricks section !

Thanks Adam.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply