lehighwiz
22nd April 2002, 18:53
I am trying to run a print session with a VB script. here is the beginning of my vb code:


Set baanobj = CreateObject("Baan4.Application")
baanobj.Timeout = 4000
SessionName = "tdsst9402m000"
FieldName = "cpcc.v"
FieldValue = "ST2"
baanobj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

SessionName = "tdsst9402m000"
FieldName = "yrno.f"
FieldValue = "2002"
baanobj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

SessionName = "tdsst9402m000"
FieldName = "yrno.t"
FieldValue = "2002"
baanobj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"


When i attempt to do the sesond ParseExecFunction I get the following error in my background baan window. Unknown Message" . Please help.

~Vamsi
2nd June 2002, 19:54
Did you try running this session from a Baan function server? It would be easier to port your code from Baan to VBA.

mark_h
3rd June 2002, 22:27
Just some thoughts - what happens if you comment out those statements. Does it get an error on the third ParseExecFunction? Just wondering if it would work if you did not use the yrno.f and yrno.t fields.

Mark