Cher tous,
lorsque j'execute ma macro il me donne l'erreur "Run-time error 91 object variable or with block variable not set"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Sub Central_Risk()
 
    Sheets("Data Signature").Select
 
    Range("A1").Select
 
With Selection.ListObject.QueryTable'<-- le execution bloque ici  sur cette ligne 
 
pls m'aider a resoudre ce probleme
 
        .Connection = Array( _
 
        "OLEDB;Provider=SQLOLEDB.1;Password=;Persist Security Info=True;User ID=;Initial Catalog=;Data Source=;" _
 
        , _
 
        "Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NGD5N2QC3J;Use Encryption for Data=False;Tag wit" _
 
        , "h column collation when possible=False")
 
        .CommandType = xlCmdSql
 
        .CommandText = Array( _
 
        "Select     distinct 
 
        )
 
        .Refresh BackgroundQuery:=False
 
    End With
 
    Sheets("Pivot TB").Select
 
    Range("A1").Select
 
    ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
 
End Sub