Skip to content
NextLytics
Megamenü_2023_Über-uns

Shaping Business Intelligence

Whether clever add-on products for SAP BI, development of meaningful dashboards or implementation of AI-based applications - we shape the future of Business Intelligence together with you. 

Megamenü_2023_Über-uns_1

About us

As a partner with deep process know-how, knowledge of the latest SAP technologies as well as high social competence and many years of project experience, we shape the future of Business Intelligence in your company too.

Megamenü_2023_Methodik

Our Methodology

The mixture of classic waterfall model and agile methodology guarantees our projects a high level of efficiency and satisfaction on both sides. Learn more about our project approach.

Products
Megamenü_2023_NextTables

NextTables

Edit data in SAP BW out of the box: NextTables makes editing tables easier, faster and more intuitive, whether you use SAP BW on HANA, SAP S/4HANA or SAP BW 4/HANA.

Megamenü_2023_Connector

NextLytics Connectors

The increasing automation of processes requires the connectivity of IT systems. NextLytics Connectors allow you to connect your SAP ecosystem with various open-source technologies.

IT-Services
Megamenü_2023_Data-Science

Data Science & Engineering

Ready for the future? As a strong partner, we will support you in the design, implementation and optimization of your AI application.

Megamenü_2023_Planning

SAP Planning

We design new planning applications using SAP BPC Embedded, IP or SAC Planning which create added value for your company.

Megamenü_2023_Dashboarding

Dashboarding

We help you with our expertise to create meaningful dashboards based on Tableau, Power BI, SAP Analytics Cloud or SAP Lumira. 

Megamenü_2023_Data-Warehouse-1

SAP Data Warehouse

Are you planning a migration to SAP HANA? We show you the challenges and which advantages a migration provides.

Business Analytics
Megamenü_2023_Procurement

Procurement Analytics

Transparent and valid figures are important, especially in companies with a decentralized structure. SAP Procurement Analytics allows you to evaluate SAP ERP data in SAP BI.

Megamenü_2023_Reporting

SAP HR Reporting & Analytics

With our standard model for reporting from SAP HCM with SAP BW, you accelerate business activities and make data from various systems available centrally and validly.

Megamenü_2023_Dataquality

Data Quality Management

In times of Big Data and IoT, maintaining high data quality is of the utmost importance. With our Data Quality Management (DQM) solution, you always keep the overview.

Career
Megamenü_2023_Karriere-2b

Working at NextLytics

If you would like to work with pleasure and don't want to miss out on your professional and personal development, we are the right choice for you!

Megamenü_2023_Karriere-1

Senior

Time for a change? Take your next professional step and work with us to shape innovation and growth in an exciting business environment!

Megamenü_2023_Karriere-5

Junior

Enough of grey theory - time to get to know the colourful reality! Start your working life with us and enjoy your work with interesting projects.

Megamenü_2023_Karriere-4-1

Students

You don't just want to study theory, but also want to experience it in practice? Check out theory and practice with us and experience where the differences are made.

Megamenü_2023_Karriere-3

Jobs

You can find all open vacancies here. Look around and submit your application - we look forward to it! If there is no matching position, please send us your unsolicited application.

Blog
NextLytics Newsletter Teaser
Sign up now for our monthly newsletter!
Sign up for newsletter
 

VBA in the SAP Analytics Cloud Excel add-in – we have tested it

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.

Technical look at the new VBA API

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.

Bild1_EN_SAP Analytics Cloud Excel add-in

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.

What the API looks like in use

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:

  • Initialization of the forecast version via a data action
  • Filtering to specific regions and periods for which the sales volume is to be planned
  • Percentage adjustment of the sales volume via another data action

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.

Gif1


SAP Planning Tools Compared -
Download the Whitepaper here!

Neuer Call-to-Action


Combined approach: SAC formulas and VBA macros

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.

Bild2_SAP Analytics Cloud Excel add-in

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.

Bild3_SAP Analytics Cloud Excel add-in

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.

Bild4_SAP Analytics Cloud Excel add-in

SAP Analytics Cloud Excel Add-in: Conclusion and outlook

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!

Learn all about Planning with SAP Analytics Cloud

 

,

avatar

David

David has 13 years of experience as an SAP consultant in the areas of SAP Data & Analytics and the energy industry. His expertise includes customer support and consulting as well as IT conception, architecture and development of SAP solutions. He is particularly specialized in SAP Planning (BPC and SAP Analytics Cloud), SAP BW/4HANA and SAP Datasphere. In his spare time, David enjoys freediving and is an enthusiastic home barista.

Got a question about this blog?
Ask David

VBA in the SAP Analytics Cloud Excel add-in – we have tested it
8:19

Blog - NextLytics AG 

Welcome to our blog. In this section we regularly report on news and background information on topics such as SAP Business Intelligence (BI), SAP Dashboarding with Lumira Designer or SAP Analytics Cloud, Machine Learning with SAP BW, Data Science and Planning with SAP Business Planning and Consolidation (BPC), SAP Integrated Planning (IP) and SAC Planning and much more.

Subscribe to our newsletter

Related Posts

Recent Posts