srinivas
25th July 2003, 10:16
I have this following macro code.
If I click the button on the excel sheet it should run a method in my customized baan dll. But it is not connecting to baan and giving the message in the createerror routine.

I am able to connect to baan directly and also the same code was working sometime back from another m/c

|*********************************************


'Declarations

Dim user As String
Dim reno As Long
Dim paramet As String
Dim Baan4Object As Object

Sub Button1_Click()
On Error GoTo createerror
Set Baan4Object = CreateObject("Baan4.Application")
On Error GoTo autoerror
Baan4Object.ParseExecFunction "otdpuritemlist", "print.list(1)"
If (Baan4Object.Error <> 0) Then GoTo autoerror
user = Baan4Object.returnvalue
Row = 1
reno = 1
Cells(Row, 1) = user
Baan4Object.Quit
Set Baan4Object = Nothing
Exit Sub

createerror:
MsgBox ("Unable to Start Baan")
Exit Sub

autoerror:
MsgBox ("Unable to Load Data.. OLE Error !!!" & Baan4Object.Error)
Baan4Object.Quit
Set Baan4Object = Nothing
Exit Sub

End Sub

lakoon
11th August 2003, 14:33
hi srinivas

which version of GUI are you using.

Please check the settings of GUI on the last folder. There you can see with which name you have to connect.

I belives you have to connect with something like:

Set Baan4Object = CreateObject("Baan4.Application.XXXXXX")

where the XXXXXX = the name of the .bwc file

/lakoon

srinivas
24th September 2003, 12:03
Thanks a lot. It is working now.