mark_h
2nd October 2001, 01:31
What I would like to do is process a series of files through a function server from excel. I have made a dll (it works) and borrowed some of the code from the Baan ole examples. The problem is that when excel runs the macro it starts the dll running and then the macro just continues, I get a baanobj.error before the dll has finished processing the file. The dll currently does not return anything to the macro - basically I read a file and create another file with the data. I need to control the parse so it waits until the first file is processed and then runs the next file. Can someone help on this?? I get a -10 error everytime - it works for the first file and then stops. Maybe if I new how to return a "all done" message it would wait before going to the next macro statement. That is problem number 2. Also I tried coding around the -10 error but it still only processed one file.
Also I do not have the source to the tuoledll examples so I am not sure how to pass data back to excel. This would be helpful when running into errors in the function server code. I could also use some help with this.
Thanks for any help or suggestions!
Mark
Here is the Excel Macro code:
BaanObj.ParseExecFunction dllname, dllfunction
' check result
errormsg = ""
if BaanObj.Error <> 0 Then
Select Case BaanObj.Error
Case Is = -1
errormsg = "DLL Unknown"
Case Is = -2
errormsg = "Function Unknown"
Case Is = -3
errormsg = "Syntax Error in Function Call"
End Select
MsgBox ("Call to Baan DLL failed, error = " & errormsg)
close_baan
End If
Also I do not have the source to the tuoledll examples so I am not sure how to pass data back to excel. This would be helpful when running into errors in the function server code. I could also use some help with this.
Thanks for any help or suggestions!
Mark
Here is the Excel Macro code:
BaanObj.ParseExecFunction dllname, dllfunction
' check result
errormsg = ""
if BaanObj.Error <> 0 Then
Select Case BaanObj.Error
Case Is = -1
errormsg = "DLL Unknown"
Case Is = -2
errormsg = "Function Unknown"
Case Is = -3
errormsg = "Syntax Error in Function Call"
End Select
MsgBox ("Call to Baan DLL failed, error = " & errormsg)
close_baan
End If