Sub ChangeParameterValue(ParameterName As String, ParameterValue As String)
Dim qry As WorkbookQuery
Dim formula As Variant
'=== Get the query
Set qry = ThisWorkbook.Queries(ParameterName)
'=== Split the formula into 3 parts and update the second one
formula = Split(qry.formula, Chr(34), 3)
formula(1) = ParameterValue
'=== Update the parameter value
qry.formula = Join(formula, Chr(34))
End Sub
Sub Maj()
Call ChangeParameterValue("Fichier", "T:\TEMP\TrucMuche.xlsx")
ThisWorkbook.RefreshAll
End Sub