If a parameter with name userid already exists in datatable, the AddParameter call will add a new parameter with name userid1, userid2 etc.
Run tis sample code:
You must check if a parameter exists, and add the parameter only if not exists, here is an example how to do it:
Run tis sample code:
Code:
For i = 1 to 3
ParamName = DataTable.GlobalSheet.AddParameter( "Param", "12" ).Name
MsgBox ParamName
Next
You must check if a parameter exists, and add the parameter only if not exists, here is an example how to do it:
Code:
Sub AddParameterIfNotExists( byval Sheet, byval ParamName, byval strValue )
On error resume next
Sheet.getParameter( ParamName ).value = strValue
If Err.Number <> 0 Then
Sheet.AddParameter ParamName, strValue
End If
End Sub
For i = 1 to 3
Call AddParameterIfNotExists( DataTable.GlobalSheet, "ParamName", i )
MsgBox DataTable.GlobalSheet.GetParameter( "ParamName" )
Next