View Single Post
Old 30th August 2017, 13:32
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Join Date: Dec 2004
Location: India, Gujarat
Posts: 599
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face Getting item description through Baan OLE automation

Hi all,

I have little or no experience related to Baan OLE automation, but i want to explore it. I want to perform a simple task as shown below:

pass an item code using stpapi.put.field
search the item record using stpapi.find
get the value of item description using stpapi.get.field

For this I have written attached code in Excel VBA. I have debugged code in VBA and it gives an error message indicating invalid number of arguments whereas I am passing three argument (sessioncode,tablefield,getfield) to stpapi.get.field function.

getfield is excel vba variable.

BaanObj.ParseExecFunction "ottstpapihand", "stpapi.get.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & "tiitm001.dsca" & Chr(34) & "," & getfield & ")"

Can anybody guide me how to write the above statement correctly in VBA so that I will get item description in getfield variable ?

Reply With Quote