Thank you very much for your answers. I'm looking at all of that!
If I try to avoid the macro it's because users are not trained in VBA and wouldn't be able to modify the code if they had to make changes in the module. And since I'm only passing through, the module would then be unusable.
Clearly the equivalent in macro would be this:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Dim L As Single
L = InputBox("L_inter_épau", "Upset")
If L > 170 Then
boolstatus = Part.Extension.SelectByID2("Large [>175mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.ShowConfiguration2("Large [>175mm]")
ElseIf L > 145 Then
boolstatus = Part.Extension.SelectByID2("Medium [145-170mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.ShowConfiguration2("Medium [145-170mm]")
Else
boolstatus = Part.Extension.SelectByID2("Small [55-145mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.ShowConfiguration2("Small [55-145mm]")
End If
End Sub