SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, code samples and tools and downloads for ASP.Net, SQL Server, R Script, Windows, Windows Phone, AWS, SAP HANA and ABAP, like SAP UI5, Screen Personas, etc.

Install SAP Free

How to Check Installed Excel Version in ABAP

ABAP programmers can check installed Excel version using ABAP class method cl_gui_frontend_services=>registry_get_value. I will share sample ABAP program codes to read registry entry using ABAP static class method cl_gui_frontend_services=>registry_get_value with corresponding registy path and registry key in this ABAP tutorial.

Excel version on a computer can be viewed by looking its registry entry as seen in following screenshot.

check Excel version by ABAP code

You can see in the registry screenshot that the registry key is can be reached by following registry path:

From our previous ABAP tutorials, SAP developers can remember read registry entries using ABAP class cl_gui_frontend_services and its static method registry_get_value
Let's use ABAP class method cl_gui_frontend_services=>registry_get_value and read registry entry for installed Excel application version on a computer.

data lv_version type string.

call method cl_gui_frontend_services=>registry_get_value
  root = 0 " => HKEY_CLASSES_ROOT
  reg_value= lv_version
  get_regvalue_failed = 1
  cntl_error = 2
  error_no_gui = 3
  not_supported_by_gui = 4
  others = 5.

The returned lv_version variable will include the Excel version.
You can map the application version to Excel product using below table.

Excel 97 = 8
Excel 2000 = 9
Excel 2002 = 10
Excel 2003 = 11
Excel 2007 = 12
Excel 2010 = 14
Excel 2013 = 15
Excel 2016 = 16

For example, I have "Excel.Application.16" for returned lv_version variable when I execute above ABAP code which maps to Microsoft Excel 2016

SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Meetup Sunumu 1 meetup

Copyright © 2004 - 2020 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems