Page 1 of 1

IBM PAFE Operations Batch Scripts

Posted: Mon Nov 21, 2022 8:21 pm
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

Re: IBM PAFE Operations Batch Scripts

Posted: Tue Nov 22, 2022 5:17 am
by gtonkin
Thanks Adam - will be really useful for some IT departments who want to push new versions from time to time.

Re: IBM PAFE Operations Batch Scripts

Posted: Tue Nov 22, 2022 6:49 pm
by Wim Gielis
This should be part of the Useful tips and tricks section !

Thanks Adam.