I am looking to assign an open, running desktop client of SAP and put it into an instance of SAPFEWSELib.GuiApplication
.
All signs point to this:
Marshal.GetActiveObject("SAPGUI");
But it does not work -- 'Invalid class string'
The closest I have come is:
Marshal.GetActiveObject("Sapgui.ScriptingCtrl.1");
Which at least gives me a different error message:
System.Runtime.InteropServices.COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))
To be clear, this is the guy I'm trying to capture:
Which when open looks like this:
SAP Client is 32-bit, and my app is also 32-bit.
I would be most grateful for any guidance. I am brand new to SAP.