
In other words, the old routine uses late binding. There's one more twist here and that is that I have another older VBA program that logs into SAP and runs remote function calls that doesn't use SAPFunctionsOCX.SAPFunctions, but rather declares variable R3 as `Public R3 As Object` and then sets R3 later in the logon code as `Set R3 = CreateObject("SAP.Functions")`.it does not use OCX. The first sign of trouble is on execution of `Functions.Connection = objConnection` Note that I'm not seeing any reference issues nor am I getting any compile errors in either environment. For some reason though, it doesn't like assigning the `Connection` property of the `Functions` SAPFunctionsOCX.SAPFunctions object in the 365 environment (please feel free to correct my verbiage on that.I know it's not quite right).

ObjConnection.ApplicationServer = "#.#.#.#"ĮstablishConnection = objConnection.Logon(0, silentLogon)Ī quick check of objConnection tells me that logon was successful.so I know that part is working on 365.

Set objConnection = LogonControl.NewConnection Set LogonControl = CreateObject("SAP.LogonControl.1") Set TableFactory = CreateObject("SAP.TableFactory.1")įunctions.Connection = objConnection 'run-time error here in Office 365 but not in on-prem Set Functions = CreateObject("SAP.Functions") Set tblReadTableData = Func.Tables("DATA") Set tblReadTableFields = Func.Tables("FIELDS") Set tblReadTableOptions = Func.Tables("OPTIONS") Set Func = Functions.Add("BBP_RFC_READ_TABLE") If objConnection Is Nothing Then LogonToSAP Public tblReadTableOptions, tblReadTableFields, tblReadTableData As SAPTableFactor圜trl.Table Public Commit As SAPFunctionsOCX.Function Private objConnection As SAPLogonCtrl.Connection Private LogonControl As SAPLogonCtrl.SAPLogonControl Public Functions As SAPFunctionsOCX.SAPFunctions

I tested a program that logs into SAP and runs RFCs in the 365 environment and I'm getting a run-time error on the line `Functions.Connection = objConnection` (Run-time error 20080008…Bad Variant Type) Option Explicit My company is making the move to Office 365 soon.
