Sub dodkd()
Dim wks 'As Worksheet
Dim linked2TCD As Boolean
Dim objTCD As PivotTable
Dim objChart As ChartObject
Dim strTCDAddress As String
For Each wks In Sheets
'si la feuille en cours de lecture n'est pas une feuille graphique
If wks.Type <> "3" Then
'présence de TCD dans la feuille ?
'ce test est commenté, l'objectif n'étant pas de manipuler le tcd lui-même
'If wks.PivotTables.count = 0 Then GoTo nnext_wks
'présence de graphique lié à un TCD ? '.... adevelopper
'If wks.ChartObjects.count = 0 Then GoTo nnext_wks
'présence de graphique avérée, mais lié à un TCD ?
For Each objChart In wks.ChartObjects
If Not objChart.Chart.PivotLayout Is Nothing Then
Set objTCD = objChart.Chart.PivotLayout.PivotTable
strTCDAddress = objTCD.TableRange2.Address(external:=True)
'appeler ici les instructions pour copie vers powerpoint
'...
'...
End If
Next objChart
'si la feuille en cours de lecture est une feuille graphique
Else
wks.Select
'si condition répondue, alors c'est lié à un TCD
If Not ActiveSheet.PivotLayout Is Nothing Then
Set objTCD = ActiveSheet.PivotLayout.PivotTable
strTCDAddress = objTCD.TableRange2.Address(external:=True)
' MsgBox strTCDAddress
'appeler ici les instructions pour copie vers powerpoint
'...
'...
End If
End If
'wks.UsedRange.Copy
' Debug.Print wks.Range(wks.PivotTables(1).TableRange2.Address).Address
nnext_wks:
Next wks
End Sub