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
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