Symptom
Callback AfterRedisplay is not executed after clicking on "Enable Content" in a macro-enabled workbook opened from BW system in Analysis Office.
Environment
SAP Analysis for Microsoft Office
Reproducing the Issue
1. Make sure macros are disabled in Excel so the user gets the message to "Enable Content" when opening a macro-enabled workbook;
2. Open macro-enabled workbook from BW system in AO, that uses the callback AfterRedisplay;
3. Confirm the callback AfterRedisplay is not executed after clicking on the "Enable Content" button;
Cause
This is not a bug in the tool. In AO 2.8 SP4 and higher versions, there is no redisplay after clicking on the "Enable Content" button.
This decision was made because the normal order of events should be WorkbookOpen, WorkbookActivate and WorkbookClose. However, before AO 2.8 SP4, after clicking on the "Enable Content" button, a WorkbookOpen event was being called again for the workbook that is already open, which was incorrect. This was leading to inconsistent states.
Resolution
The callback AfterRedisplay will only be executed in macro-enabled workbooks that are not blocked by Excel.
The steps below can be followed so the workbooks opened from BW system in AO will not get blocked by Excel:
- 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 will be saved;
- Go to the Excel's Trust Center settings and add your preferred folder to the Trusted Locations.
Once both settings are saved, the AO workbooks should not be opened in a protected view anymore, so the callback AfterRedisplay will be executed.
For more information about the setting "DocumentCacheFolderPath", go to this chapter in Administrator Guide.
Keywords
Workbook_SAP_Initialize, AfterRedisplay, macros, xlsm, trusted , KBA , BI-RA-AO-XLA , Excel Addin , Problem