Symptom
'Call Application.Run("SAPExecutePlanningSequence","XXX")' in Callback_AfterRedisplay does not work.
Environment
SAP Analysis for Microsoft Office
Reproducing the Issue
Execute API SAPExecutePlanningSequence in API AfterRedisplay.
For example:
Public Sub Callback_AfterRedisplay()
Dim IResult As_Long
IResult = Application.Run("SAPExecutePlanningSequence","PS_1")
End Sub
Cause
The usage of the command SAPExecutePlanningSequence (as well as most other commands) inside the AfterRedisplay callback is blocked by Analysis Office.
The return value of the VBA command is 0 and Application.Run("SAPGetProperty", "LastError") (see section "Using LastError information" in the documentation) will return 13 - "A callback is running.".
The reason is that the execution of the planning sequence will again trigger a redisplay which will again run the AfterRedisplay callback and result in an endless loop.
Resolution
API SAPExecutePlanningSequence is not supported within API AfterRedisplay
See Also
3096766 - Command inside a callback is not working in Analysis Office
Keywords
SAPExecutePlanningSequence, API, AfterRedisplay, Callback_AfterRedisplay , KBA , BI-RA-AO-XLA , Excel Addin , How To