renyc95
22nd August 2003, 06:35
Hi,
I am having this problem with my client saying that she could not run her macro Excel file (Excel for WinXP) on new platform PC (WinXP). This macro Excel will actually call Baan object which requires user to login her ID and connect to the Baan server. The macro will further invoke Baan libraries and extract sales information from respective tables in Baan.
So far , she had no problems running the macro Excel program on older platform (old PC) which is on Win98 (Excel97).
Below is part of the macro program that i extract from the original file and when i debugged, the part when it has error running.
' Name : StartBaanSearch
' Short Description : Main function that controls the logic and execution of the
' : search.
Function StartBaanSearch()
On Error GoTo ErrorDetected
'Export the Selection Criteria variables to the export variables
Call PopulateExportVariables
' start BW if not yet connected
If Baan4Object Is Nothing Then
Set Baan4Object = CreateObject("Baan4.Application")
'Baan4Object.Timeout = 5000
Baan4Object.Timeout = 50000000
End If
If (Baan4Object.Error <> 0) Then
Call Baan4AutomationError
End If
'Populate the arguments for the DLL function
dllname = "otfacrole9999"
dllfunction = "send.selection.criteria("
dllfunction = dllfunction & Chr$(34)
dllfunction = dllfunction & Trim(year_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(year_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(Period_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(Period_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(crep_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(crep_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(cuno_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(cuno_to) & Chr$(34)
dllfunction = dllfunction & ")"
ReturnStatus = Baan4Object.ParseExecFunction(dllname, dllfunction)
If (Baan4Object.Error <> 0) Then
Call Baan4AutomationError
End If
Return_Value = Baan4Object.ReturnValue
Row = 6
Column = 1
On the above example, the ReturnStatus value is (-10) after it executes Baan4Object.ParseExecFunction(dllname,dllfunction) and when this happen, it will call the baan4automationerror function and disconnect from Baan server.
However, when i run the same macro on the older platform (win98) excel 97, there is no such problem.
Can anyone help me as users demand explanation why the program could not be run on her new PC? Is this has to do with incompatability of Baan version. Currently the baan version is Baan4a with porting set 6.1c.06.02.
Regards
I am having this problem with my client saying that she could not run her macro Excel file (Excel for WinXP) on new platform PC (WinXP). This macro Excel will actually call Baan object which requires user to login her ID and connect to the Baan server. The macro will further invoke Baan libraries and extract sales information from respective tables in Baan.
So far , she had no problems running the macro Excel program on older platform (old PC) which is on Win98 (Excel97).
Below is part of the macro program that i extract from the original file and when i debugged, the part when it has error running.
' Name : StartBaanSearch
' Short Description : Main function that controls the logic and execution of the
' : search.
Function StartBaanSearch()
On Error GoTo ErrorDetected
'Export the Selection Criteria variables to the export variables
Call PopulateExportVariables
' start BW if not yet connected
If Baan4Object Is Nothing Then
Set Baan4Object = CreateObject("Baan4.Application")
'Baan4Object.Timeout = 5000
Baan4Object.Timeout = 50000000
End If
If (Baan4Object.Error <> 0) Then
Call Baan4AutomationError
End If
'Populate the arguments for the DLL function
dllname = "otfacrole9999"
dllfunction = "send.selection.criteria("
dllfunction = dllfunction & Chr$(34)
dllfunction = dllfunction & Trim(year_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(year_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(Period_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(Period_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(crep_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(crep_to)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(cuno_from)
dllfunction = dllfunction & Chr$(34) & "," & Chr$(34)
dllfunction = dllfunction & Trim(cuno_to) & Chr$(34)
dllfunction = dllfunction & ")"
ReturnStatus = Baan4Object.ParseExecFunction(dllname, dllfunction)
If (Baan4Object.Error <> 0) Then
Call Baan4AutomationError
End If
Return_Value = Baan4Object.ReturnValue
Row = 6
Column = 1
On the above example, the ReturnStatus value is (-10) after it executes Baan4Object.ParseExecFunction(dllname,dllfunction) and when this happen, it will call the baan4automationerror function and disconnect from Baan server.
However, when i run the same macro on the older platform (win98) excel 97, there is no such problem.
Can anyone help me as users demand explanation why the program could not be run on her new PC? Is this has to do with incompatability of Baan version. Currently the baan version is Baan4a with porting set 6.1c.06.02.
Regards