Skip to Content

SAP Logon Using Excel VBA MS Office 64-Bit (Win 10)

Feb 21, 2017 at 08:40 PM


avatar image
Former Member


i'm using MS Excel 2013 and Win 7 to Logon to SAP with VBA (SAP 740 Final Release, Version 7400.

Code Below:

Sub SAPCon()
    Dim R3 As Object
    Set R3 = CreateObject("SAP.Functions")
    ZSID = "XYZ"
    Dim myFunc1, QUERY_TABLE1, RowCount1 As Object
    Set myFunc1 = R3.Add("RFC_READ_TABLE")
    If R3.Connection.Logon(0, True) <> True Then
        MsgBox "Cannot Log on to SAP"
        Exit Sub
    End If
End Sub

But when using Win 10 and MS Excel 2016 (64-Bit), I've got error:

Any different VBA Code to Logon to SAP using Win 10 and Office 2016 (64-Bit)?

Since I can't roll back the windows and MS Office installation because of IT Division policy in our company.

I can't also download activex or dll file and register it to the machine (IT Division policy) -

Thank You.

10 |10000 characters needed characters left characters exceeded

Hi Iwan,

Welcome to the SAP Community! I took the liberty of editing the tags associated with your question. I'm pretty sure "Logging of UI SAP GUI for Windows" is not what you were looking for. I'm not 100% certain, but I believe "SAP Gateway for Microsoft" is the right tag for this, as it is about connecting .NET applications (and Visual Studio, and apps like Excel) to SAP systems. I threw in the "NetWeaver" secondary tags because I'm not certain about that primary tag.


* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raj Singh Mar 02 at 10:53 PM


Were you able to resolve this?

If not, please try


If R3.Connection.logon(0, False) <> True Then

MsgBox ("Logon Failed")


' MsgBox ("Login OK")

End If



Shivraj Singh

10 |10000 characters needed characters left characters exceeded