The FIRST thing to check is whether the Windows 10 PCs with Office 365 have the registry key HKCR\SAP.BAPI.1. Whether you accept it or not, the most likely reason CreateObject fails is that there are problems in the registry key for [D]COM object you're trying to create. Thus best to eliminate that possibility first.
From a different perspective, your Windows 10 machines also have Windows Script Host/VBScript. You could confirm that this SAP object is working by using this VBScript file
test.vbs
Run this from a console command prompt as cscript test.vbs. If there's a systemic problem with that [D]COM object, you should see an error message like
E:\me\battest\test.vbs(3, 1) WScript.CreateObject: Could not locate automation class named "SAP.BAPI.1".
If you see something like that, the problem would be that the SAP BAPI control isn't properly installed.
This would be a configuration issue, and it's a dead certainty there are configuration differences between PCs running Windows 10 and Office 365 and other PCs running older versions of either Windows or Office.
If the VBScript file above doesn't display an error, then VBScript could create a SAP BAPI object, but Excel couldn't. At that point you would need to confirm that your version of that SAP control is compatible with Excel in Office 365.
Bookmarks