With the Q2 2025 release, SAP has added a key feature to the SAP Analytics Cloud (SAC) Excel add-in that many planning managers and Excel power users have been waiting for: VBA support.
VBA (Visual Basic for Applications) has always been a central component of Excel-based reporting tools such as BEx Analyzer and, especially, Analysis for Office (AfO). In planning workbooks in particular, it is common practice to control relevant functions directly via VBA macros using buttons, drop-down menus, or other UI elements. This allows planning functions to be triggered and even parameterized. Standard actions such as resetting entries or saving changed values can also be easily controlled via macros – without having to go via the ribbon menu. In addition, VBA enables optimized user guidance, for example through individually designed MsgBoxes or pop-up confirmations. This flexibility was previously missing in the SAC add-in. With the current release, this is beginning to change.
The SAC add-in is the strategic front end for SAC Planning (including Seamless Planning) and also enables access to analytical models in Datasphere. AfO, on the other hand, is limited to classic BW-based planning in the planning area and only supports the outdated analytical datasets in Datasphere, which will no longer play a role in the future. In an earlier blog post, we already highlighted the differences between the established Analysis for Office and the newer SAC Excel add-in in detail.
The SAC Excel add-in is based entirely on web technologies (JavaScript/HTML). It is not installed locally, but activated directly via the Microsoft Store. Technically, the add-in runs in the background in an isolated browser context, unlike the native COM integration of AfO.
Since the runtime environments are separate, direct communication between VBA and the add-in is not possible. Instead, communication takes place via asynchronous message transfer. For this purpose, SAP provides an additional macro add-in file called SAPOFXLA.xlam and a corresponding PDF documentation file, which can currently only be downloaded via SAP Note 3594453. This file acts as a bridge between VBA and the web add-in and, unlike the SAC add-in itself, must be installed on every client computer and integrated into the respective Excel workbook for the VBA integration to work. SAP recommends centralizing the file, e.g., via a shared network drive or software distribution.
Even if synchronous API calls are possible in Windows, the API only works asynchronously on Mac, which is why asynchronous logic should always be used. This involves working with callback mechanisms, which differs significantly from the usual way of working in AfO. Communication with the add-in can also be lost if the logic is paused in debug mode or the system load is high.
To get to know the new VBA API better, we used our recently introduced Seamless Planning demo model based on our NextJuice sales data. The goal was to map typical planning logic directly in the SAC Excel add-in and check how this could be implemented technically using the new API.
Specifically, the following steps were involved:
The execution of the data actions should first be confirmed via pop-up windows. Depending on the result, an individual success or error message should then appear.
The following GIF shows how the corresponding planning workbook was designed. It shows the process from the user's perspective, including buttons, input fields, and guided user interaction. A combination of the SAC formulas available in the add-in and additional VBA logic is used, which we will explain in more detail in the next section.
Before we take a closer look at VBA integration, it is worth taking a look at the SAP formulas already available in the add-in, which also enable important control functions. Formulas such as SAP.BLOCK and SAP.ASYMMETRICFILTER can be used to trigger specific changes or set filters dynamically, e.g., for a rolling forecast view (see example from the SAP Community), which we also use in our planning table.
To call the data action for initializing the forecast version, we wrote a VBA macro that must first be confirmed in a pop-up window before execution. The code shows that asynchronous mode is used and the DataActionCallback method was passed as a callback.
DataActionCallback is a separate macro that is automatically called after the Data Action is completed. It displays a message indicating whether the process was successful or an error occurred. In addition, if successful, another asynchronous API function is called that updates the entire workbook so that the changes in the table are immediately visible. The associated callback method of the Refresh command only displays another message in case of an error.
Calling the data action to adjust the sales quantity by percentage follows the same logic and is not shown separately here. In this case, we primarily use the formula SAP.GETPLANNINGTRIGGERPARAMETERVALUE, which displays the parameter values of the data action directly in the sheet and allows them to be edited using the edit icon that appears. This allows planners to make the necessary entries for the data action directly and user-friendly in the table context, without VBA and without having to go through the menu.
The VBA API provided works reliably in general. After a brief introduction to the syntax and asynchronous execution, user-friendly functions and simplified processes can be implemented. Saving the workbook on the SAC and subsequent execution by other users also worked without any problems in testing. The official documentation in the SAP Help Portal does not yet contain any information about the API; instead, you have to refer to the separate PDF file from the SAP note. Although this provides the necessary technical basics, it contains only a few practical examples. A stronger focus on real-world use cases, such as the typical sequence of events from data action trigger to refresh to publish or revert, would be desirable and would make it easier for many users to get started.
We particularly liked the possibilities offered by combining the VBA API and the SAP formulas that can be used in the add-in. Unlike AfO (with exceptions: SAPSetData andSAPSetFilterComponent), these are not only used to display values or status information. Some formulas also enable active control. The smart linking of cell values allows for interactive workflows without having to solve every step via VBA.
A direct comparison of the VBA API with AfO is therefore limited. AfO is closely aligned with BW query logic and BW-based planning, while the SAC Excel add-in was developed specifically for SAC planning. Nevertheless, on closer inspection, it becomes apparent that AfO currently offers even more flexibility. In AfO, formulas can be used directly in VBA code and the return values can be further processed. There is a separate table design API and even the option of communicating directly with the ABAP backend system via BAdIs.
Even if many of these functions cannot be expected to be available 1:1 in the SAC Excel add-in, it is to be hoped that SAP will continue to expand the new VBA API. For example, it would be useful to be able to set parameter values for data actions directly via VBA, pass filters for dimensions dynamically, execute formulas in macros, and trigger multi-actions via VBA. The last of these is currently still missing from the add-in.
Do you have questions on this or another topic? Simply get in touch with us - we look forward to exchanging ideas with you!