sardaukar
05-25-2007, 10:14 AM
Hello all!
I have the following code :
Sub ChartPict_save()
Dim sFName As String
Dim Pict As Object
Dim ch
Dim i As Integer
i = 1
Sheets("Ocorr?ncias por Tipo").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Pivot Chart").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Indisponibilidade").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Tempo de Resposta").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Problemas").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Set ch = Nothing
End Sub
It's a mix of 90% code I googled for and some personal customizations. I managed to export the charts on all my sheets, but not all of them. For example, if a sheet has 3 charts, it only dumps 1. I have another sheet with 3 and it only dumps 2 of them. How can this be? What makes the charts that are not being exported different?
Thanks for any help!
I have the following code :
Sub ChartPict_save()
Dim sFName As String
Dim Pict As Object
Dim ch
Dim i As Integer
i = 1
Sheets("Ocorr?ncias por Tipo").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Pivot Chart").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Indisponibilidade").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Tempo de Resposta").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Sheets("Problemas").Select
For Each Pict In ActiveSheet.ChartObjects
Set ch = Pict.Chart
sFName = HTMLExportForm.exportPath & "graph" & i & ".gif"
ch.Export Filename:=sFName, FilterName:="GIF"
i = i + 1
Next
Set ch = Nothing
End Sub
It's a mix of 90% code I googled for and some personal customizations. I managed to export the charts on all my sheets, but not all of them. For example, if a sheet has 3 charts, it only dumps 1. I have another sheet with 3 and it only dumps 2 of them. How can this be? What makes the charts that are not being exported different?
Thanks for any help!