We used to use RFC connection in excel (VBA) from SAP query with object "SAP.LogonControl.1" on 32 bit WIN and OFFICE. Now we installed 64 bit version of WIN and OFFICE and we have a problem with "ActiveX component can't create object". Here is the line, where it was fall: Set functionCtrl = CreateObject("SAP.LogonControl.1") Somebody some solution? Installation to 32bit is unwanted.
4 Answers
Please see SAP note 1442028: SAP GUI for Windows - Support for Office 64bit editions.
By default 64bit programs cannot load 32bit programs. Since SAP GUI for Windows is a 32bit program, which is also true for its Active libraries like LogonControl, it is not compatible with 64bit Office. Alternatively you can use 32bit Office on a 64bit Windows.
There are workaounds via DLL surrogates, but they require changes to the registry and might not be stable longterm.
We found a solution. We use SAPGUI 7.50, repair some registy (surrogate) and use SAP.Function instead of SAP.LogonControl.1. Thats all. It works. Here are our registry changes:
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
@="SAP Remote Function Call"
"AppID"="{5B076C03-2F26-11CF-9AE5-0800096E19F4}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\Control]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\InprocServer32]
@="c:\\program files (x86)\\sap\\frontend\\sapgui\\wdtfuncs.ocx"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\MiscStatus]
@="0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\MiscStatus\1]
@="132241"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\ProgID]
@="SAP.Functions"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\ToolboxBitmap32]
@="c:\\program files (x86)\\sap\\frontend\\sapgui\\wdtfuncs.ocx, 1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\TypeLib]
@="{5B076C00-2F26-11CF-9AE5-0800096E19F4}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\Version]
@="5.0"
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
"DllSurrogate"=""
Date: 2020-11-26 There is a SAP Support OSS Note (‘2724656’), Where SAP is saying they are not supporting Office 64 bits till next year (2021) with the arrival of SAPgui 770 (Thus NOT yet with SAPgui 760)
The Surrogate solution provided above works fine with both SAPgui 750 and 760 but it covers only 1 of the actual 4 ActiveX controls
Here is the full solution for the 4 Controls if you have them in same path as here below:
c:\program files (x86)\sap\frontend\sapgui\wdtaocx.ocx (SAP Table Factory)
c:\program files (x86)\sap\frontend\sapgui\wdobapi.ocx (SAP BAPI Control)
C:\Program Files (x86)\Common Files\SAP Shared\wdtlog.ocx (SAP Logon Control)
c:\program files (x86)\sap\frontend\sapgui\wdtfuncs.ocx (SAP Remote Function Call Control)
Solution, create a *.reg file and Merge it to your Windows Registry: (do this first on a test system) - Content of the *.reg file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}]
@="SAP BAPI"
"AppID"="{2E9A4698-F0EE-11CF-AC55-080009D213D2}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
@="SAP Remote Function Call"
"AppID"="{5B076C03-2F26-11CF-9AE5-0800096E19F4}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}]
@="SAP Logon Control"
"AppID"="{B24944D6-1501-11CF-8981-0000E8A49FA0}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}]
@="SAP Table Factory"
"AppID"="{87D2850E-6B43-101C-92CE-10005AF5DF4D}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\Control]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\Control]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\Control]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\Control]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\InprocServer32]
@="c:\program files (x86)\sap\frontend\sapgui\wdobapi.ocx"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\InprocServer32]
@="c:\program files (x86)\sap\frontend\sapgui\wdtfuncs.ocx"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\InprocServer32]
@="C:\Program Files (x86)\Common Files\SAP Shared\wdtlog.ocx"
"ThreadingModel"="both"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\InprocServer32]
@="c:\program files (x86)\sap\frontend\sapgui\wdtaocx.ocx"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\MiscStatus]
@="0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\MiscStatus\1]
@="131474"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\MiscStatus]
@="0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\MiscStatus\1]
@="132241"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\MiscStatus]
@="0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\MiscStatus\1]
@="135569"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\MiscStatus]
@="0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\MiscStatus\1]
@="132498"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\ProgID]
@="SAP.BAPI.1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\ProgID]
@="SAP.Functions"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\ProgID]
@="SAP.LogonControl.1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\ProgID]
@="SAP.TableFactory.1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\ToolboxBitmap32]
@="c:\program files (x86)\sap\frontend\sapgui\wdobapi.ocx, 200"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\ToolboxBitmap32]
@="c:\program files (x86)\sap\frontend\sapgui\wdtfuncs.ocx, 1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\ToolboxBitmap32]
@="C:\Program Files (x86)\Common Files\SAP Shared\wdtlog.ocx, 1001"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\ToolboxBitmap32]
@="c:\program files (x86)\sap\frontend\sapgui\wdtaocx.ocx, 2002"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\TypeLib]
@="{2E9A4698-F0EE-11CF-AC55-080009D213D2}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\TypeLib]
@="{5B076C00-2F26-11CF-9AE5-0800096E19F4}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\TypeLib]
@="{B24944D6-1501-11CF-8981-0000E8A49FA0}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\TypeLib]
@="{87D2850E-6B43-101C-92CE-10005AF5DF4D}"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}\Version]
@="1.2"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}\Version]
@="5.0"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B24944D6-1501-11CF-8981-0000E8A49FA0}\Version]
@="1.1"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}\Version]
@="1.1"
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{2E9A4698-F0EE-11CF-AC55-080009D213D2}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{5B076C03-2F26-11CF-9AE5-0800096E19F4}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{B24944D6-1501-11CF-8981-0000E8A49FA0}]
"DllSurrogate"=""
[HKEY_CLASSES_ROOT\WOW6432Node\AppID\{87D2850E-6B43-101C-92CE-10005AF5DF4D}]
"DllSurrogate"=""
As of February 2021, SAP have finally released a 64 bit version of the NWRFC controls that allow direct use within 64bit MS Office. This was included with the 770 GUI, that is now widely available and on a stable patch 3 as of July 2021. SAP GUI 770 release. This means that the Surrogate solution in earlier answers is no longer needed!
This Note 2724656 has some information on NWRFC, but this is what you need to know:
If NWRFC is correctly installed then there will be a set of the four .ocx controls installed on the C:\Program Files\SAP\FrontEnd\SAPgui
folder, e.g. wdtfuncs.ocx
. Note that there will be an identically named 32bit control in the C:\Program Files (x86)\SAP\FrontEnd\SAPgui
folder also.
Office 64bit VBA should pick up the new controls automatically, but to be sure, in VBA, open "References", and ensure that the controls show the path to the 64bit folder (or Edit/Add a reference to the .ocx controls).