Symptom
Open an AO workbook that contains macros, error "Cannot run the macro 'XXXXXX'. The macro may not be available in this workbook or all macros may be disabled." occurs after executing macro.
Environment
SAP Analysis for Microsoft Office
Reproducing the Issue
- Open an AO workbook contains macros.
- Try to execute Macro via clicking macro.
- Error "Cannot run the macro 'XXXXXX'. The macro may not be available in this workbook or all macros may be disabled." occurs.
- Besides, if the setting "Disable VBA macros with notification" is checked in Macro settings of Trust Center, the message "SECURITY WARNING: Macros have been disabled. Enable Content" will display in security warning bar below the Excel ribbon.
Cause
Macros have been disabled due to security settings. This can be checked via Excel >File >Trust Center >Trust Center Setting... >Macro Settings, one of the following three settings is checked in client Machine.
- Disable VBA macros without notificatgion
- Disable VBA macros with notification
- Disable VBA macros except digitally signed macros
Resolution
- Enable macro via checking the setting "Enable VBA macros (not recommended; potentially dangerous code can run)" in Macro Settings of Trust Center.
- In case enable macro is not allowed due to security reason, for locally saved AO workbooks, add the folder path where these workbooks are saved to Excel Trusted Locations via: Excel > File > Options > Trust Center >Trust Center Settings... > Trusted Locations > Add new location. For AO workbooks are only saved on BI LaunchPad or BW systems, follow the steps as below:
- Go to Excel File > Analysis > Customize Analysis > Technical Configuration.
- Search for setting "DocumentCacheFolderPath" and add your preferred folder where the AO workbooks opened from BW system or BI LaunchPad will be saved.
- Add the folder path to the Trusted Locations of Excel.
- If digital signature has been added to macros and Macro Setting "Disable VBA macros except digitally signed macros" is checked, for locally saved workbook, no need to add them to Trusted Locations. However, for BI LaunchPad or BW systems saved Ao workbooks, still need to maintain setting "DocumentCacheFolderPath" to a folder path, and add this folder path to the Trusted Locations as well.
See Also
- SAP Analysis for Microsoft Office Administrator Guide
- KBA 2083067 - How to maintain settings for Analysis Office.
- Description of digital signatures and code signing in workbooks in Excel
- Digitally sign your macro project
Keywords
VBA, VBA project, VBA function, Microsoft Excel, Trust Center, digital signature, macro blocked, macros signed, trusted site, trusted publishers, Because of your security settings, macros have been disabled. To run macros, you need to reopen this workbook, and then choose to enable macros. For more information about enabling macros. click Help, can not execute macro , KBA , BI-RA-AO-XLA , Excel Addin , How To
SAP Knowledge Base Article - Public