Sub stock()
ReDim NomFich(0)
Dim Nms As Name, LeGraph As Object, Fich$, N%
Dim tablo, j%, k%
Application.ScreenUpdating = False: N = 1
For Each sh In Sheets
ActiveWorkbook.Names.Add Name:="Fiche" & N, RefersToR1C1:="=" & sh.Name & "!R1C1:R29C5"
NomFich(UBound(NomFich)) = "Fiche" & N ' a quoi te sert NomFich dans cette macro?
ReDim Preserve NomFich(UBound(NomFich) + 1)
N = N + 1
Next
ReDim Preserve NomFich(UBound(NomFich)): ReDim tablo(UBound(NomFich))
MsgBox UBound(NomFich) 'pour TEST
MsgBox UBound(tablo) 'pour TEST
j = 0
For Each Nms In ActiveWorkbook.Names
If Left(Nms.Name, 5) = "Fiche" And Nms.Visible = True Then
j = j + 1
Range(Nms.Name).CopyPicture
Set LeGraph = ActiveSheet.ChartObjects.Add(0, 0, Range(Nms.Name).Width, Range(Nms.Name).Height)
LeGraph.Chart.Paste
Fich = ActiveWorkbook.Path & "\" & Nms.Name & ".gif"
MsgBox "test: " & Fich ' pour TEST
tablo(j) = Fich
LeGraph.Chart.Export Filename:=Fich, FilterName:="GIF"
LeGraph.Delete
End If
Next Nms
MsgBox j 'pour TEST
For k = LBound(tablo) To UBound(tablo)
Debug.Print tablo(k)
Next k
End Sub