I see that when you Set the value of the "pdl" variable, you are using a variable named "parametre". Is that variable spelled correctly? Has that variable been defined as the Parameters, or ModelParameters, or UserParameters collection of a document before this point in the code?
If the value of TextBox1 is 5 and the value of the parameter named "pdl" is 10, then yes [5 > 10] will equal False, because 5 is not 'larger than' 10. However, in your situation the value of the TextBox1 (if it is defined as a MSForms.TextBox) is most likely being understood as a Variant, and the value of the Parameter is most likely being understood as Variant, and since a Variant can hold nearly any type of data, they likely aren't being compared correctly. So, what you may have to do before you can properly compare the two values is convert the value of both the TextBox1 and the Parameter to a Double, before attempting to compare them (similar to what @FINET_Laurent suggested).
Here's an example of how to do this: (I've added some code and variables to define the objects involved, but you can just delete those if they are already defined within your code.)
Dim oPDoc As PartDocument
Set oPDoc = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition
Set oPDef = oPDoc.ComponentDefinition
Dim oParams As Parameters
Set oParams = oPDef.Parameters
Dim pdl As Parameter
Set pdl = oParams.Item("pdl")
Dim TextBox1 As MSForms.TextBox
'Set TextBox1 =
If CDbl(TextBox1.Value) > CDbl(pdl.Value) Then
MsgBox "Warning detection"
Else
pdp.Expression = TextBox1.Text
End If
You'll notice that I am encapsulating both sides of the comparison using a simple conversion code, so they will both be understood as Double Type data, which is what the < & > operators are meant to compare.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' 👍.
If you have time, please... Vote For My IDEAS 💡and Explore My CONTRIBUTIONS
Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)