Public Sub obj_classif()
Dim cn As New ADODB.Connection
Dim db_name, Username, Password As String
Dim adoCMD As ADODB.Command
Dim adoRS As ADODB.Recordset
Dim param1, param2 As ADODB.Parameter
Set wb = Excel.ActiveWorkbook
Set ih = wb.Sheets("InfoSheet")
db_name = ih.Cells(1, 2) 'Instanzname
Username = ih.Cells(2, 2) 'Login
Password = ih.Cells(3, 2) 'Passwort
Set cn = New ADODB.Connection
cn.ConnectionTimeout = 600
cn.Open db_name, Username, Password
'Define attachment to database table specifics and execute commands via With block
Set adoCMD = New ADODB.Command
With adoCMD
.ActiveConnection = cn
.CommandText = "s#mdb$stg_da_extr_util.get_all_classes_of_classif"
.CommandType = adCmdStoredProc
.Parameters.Refresh
Set ParamReturn = .CreateParameter("result_line", adVarChar, adParamReturnValue, 1)
.Parameters.Append ParamReturn
Set param1 = .CreateParameter("STG_DATA_REQUEST", adVarChar, adParamInput, 1)
.Parameters.Append param1
Set param2 = .CreateParameter(120, adInteger, adParamInput, 1)
.Parameters.Append param2
Set adoRS = .Execute() '******here comes the error
End With
MsgBox adoCMD.Parameters("result_line")
End Sub