|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
现在我们想在excel里连接SAP然后把数据下载到excel里(是在excel里执行)我尝试写了一下,但是现在不知道那些对象的方法了属性,没办法做了,大家帮我看看,对了,这里的单引号其实都是双引号,郁闷,还有错别字
Set oFunction = CreateObject("SAP.LogonControl.1")
Set oConnection = oFunction.NewConnection
oConnection.Client = "100"
oConnection.Language = "EN"
oConnection.User = "用户名"
oConnection.Password = "用户密码"
oConnection.ApplicationServer = "系统IP地址"
oConnection.SystemNumber = "00"
result = oConnection.Logon(0, True)
ll = MsgBox(result, vbOKCancel, "connect ok")
Set ofun = CreateObject("SAP.FUNCTIONS")
Set ofun.Connection = oConnection
Set func = ofun.Add("RFC_READ_TABLE")
func.Exports("QUERY_TABLE") = "table名字"
If func.Call = True Then
For i = 2 To 6
Cells(i, 1).Value = func(i - 1, "MATNR")
Next i
Else
MsgBox "FAIL"
End If
提示错误的参数号或无效的属性值
该贴已经同步到 xiaoerp的微博 |
|