Wilson Peña
26th April 2005, 20:28
Hi Everybody:
I'm testing Baan and Excel. I created a bottom with the following code:
The script run ok, but when I see the table, nothing happend. I suppose that I can Insert data, please urgent what is the problem,
I'm testing with Baan Vc.
Thanks
Private Sub BaaN_Click()
'
' Correr_sesion_de_baan Macro
'
Dim ssql As String
Dim erreur As String
Dim errmess As String
Dim baanobj As Object
Dim codigo As String
Dim descripcion As String
Dim i As Integer
Dim error As String
cRow = 4
cColumn = 3
dRow = 4
dColumn = 4
'If Worksheets("Conjuntos").Cells(cRow, cColumn) = "" Then
' MsgBox "Código Conjunto no puede ser vacío"
'Else
' codigo = Worksheets("Conjuntos").Cells(cRow, cColumn)
' descripcion = Worksheets("Conjuntos").Cells(dRow, dColumn)
do_update = "1"
codigo = "WPA"
descripcion = "Ingreso de Excel"
Set baanobj = CreateObject("Baan.Application.BaanERP")
' ssql = "stpapi.put.Field(" & Chr(34) & "tcmab0105m000" & Chr(34) & ", " & Chr(34) & "tcmab005.conj" & Chr(34) & ", " & Chr(34) & "UNO" & Chr(34) & ")"
ssql = "stpapi.put.Field(" & Chr(34) & "tcmcs0145m000" & Chr(34) & ", " & Chr(34) & "tcmcs045.creq" & Chr(34) & ", " & Chr(34) & codigo & Chr(34) & ")"
erreur = baanobj.ParseExecFunction("ottstpapihand", ssql)
' ssql = "stpapi.put.Field(" & Chr(34) & "tcmab0105m000" & Chr(34) & ", " & Chr(34) & "tcmab005.dsca" & Chr(34) & ", " & Chr(34) & "Creado desde visual" & Chr(34) & ")"
ssql = "stpapi.put.Field(" & Chr(34) & "tcmcs0145m000" & Chr(34) & ", " & Chr(34) & "tcmcs045.dsca" & Chr(34) & ", " & Chr(34) & descripcion & Chr(34) & ")"
erreur = baanobj.ParseExecFunction("ottstpapihand", ssql)
baanobj.ParseExecFunction "ottstpapihand", "stpapi.insert(" & Chr(34) & "tcmcs0145m000" & Chr(34) & "," & do_update & "," & Chr(34) & "errmess" & Chr(34) & ")"
errmess = Val(baanobj.ReturnValue)
If baanobj.error = 0 Then
MsgBox "Codigo de conjunto " & codigo & " añadido"
' Worksheets("Conjuntos").Cells(13, 3) = codigo
' Worksheets("Conjuntos").Cells(13, 4) = descripcion
' Worksheets("Conjuntos").Cells(cRow, cColumn) = ""
' Worksheets("Conjuntos").Cells(dRow, dColumn) = ""
End If
erreur = baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & "tcmcs0145m000" & Chr(34) & "," & Chr(34) & "errmess" & Chr(34) & ")")
'End If
End Sub
I'm testing Baan and Excel. I created a bottom with the following code:
The script run ok, but when I see the table, nothing happend. I suppose that I can Insert data, please urgent what is the problem,
I'm testing with Baan Vc.
Thanks
Private Sub BaaN_Click()
'
' Correr_sesion_de_baan Macro
'
Dim ssql As String
Dim erreur As String
Dim errmess As String
Dim baanobj As Object
Dim codigo As String
Dim descripcion As String
Dim i As Integer
Dim error As String
cRow = 4
cColumn = 3
dRow = 4
dColumn = 4
'If Worksheets("Conjuntos").Cells(cRow, cColumn) = "" Then
' MsgBox "Código Conjunto no puede ser vacío"
'Else
' codigo = Worksheets("Conjuntos").Cells(cRow, cColumn)
' descripcion = Worksheets("Conjuntos").Cells(dRow, dColumn)
do_update = "1"
codigo = "WPA"
descripcion = "Ingreso de Excel"
Set baanobj = CreateObject("Baan.Application.BaanERP")
' ssql = "stpapi.put.Field(" & Chr(34) & "tcmab0105m000" & Chr(34) & ", " & Chr(34) & "tcmab005.conj" & Chr(34) & ", " & Chr(34) & "UNO" & Chr(34) & ")"
ssql = "stpapi.put.Field(" & Chr(34) & "tcmcs0145m000" & Chr(34) & ", " & Chr(34) & "tcmcs045.creq" & Chr(34) & ", " & Chr(34) & codigo & Chr(34) & ")"
erreur = baanobj.ParseExecFunction("ottstpapihand", ssql)
' ssql = "stpapi.put.Field(" & Chr(34) & "tcmab0105m000" & Chr(34) & ", " & Chr(34) & "tcmab005.dsca" & Chr(34) & ", " & Chr(34) & "Creado desde visual" & Chr(34) & ")"
ssql = "stpapi.put.Field(" & Chr(34) & "tcmcs0145m000" & Chr(34) & ", " & Chr(34) & "tcmcs045.dsca" & Chr(34) & ", " & Chr(34) & descripcion & Chr(34) & ")"
erreur = baanobj.ParseExecFunction("ottstpapihand", ssql)
baanobj.ParseExecFunction "ottstpapihand", "stpapi.insert(" & Chr(34) & "tcmcs0145m000" & Chr(34) & "," & do_update & "," & Chr(34) & "errmess" & Chr(34) & ")"
errmess = Val(baanobj.ReturnValue)
If baanobj.error = 0 Then
MsgBox "Codigo de conjunto " & codigo & " añadido"
' Worksheets("Conjuntos").Cells(13, 3) = codigo
' Worksheets("Conjuntos").Cells(13, 4) = descripcion
' Worksheets("Conjuntos").Cells(cRow, cColumn) = ""
' Worksheets("Conjuntos").Cells(dRow, dColumn) = ""
End If
erreur = baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & "tcmcs0145m000" & Chr(34) & "," & Chr(34) & "errmess" & Chr(34) & ")")
'End If
End Sub