Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
looping through chartobjects returns deleted charts also
What I want to do is to export all charts in my workbook as gifs. This works
fine, normally, but if I delete a chart, it will still be exported! The exported gif is then empty. No image. Here is the routine: Dim wks As Worksheet Dim cht As ChartObject Dim strImage As String Dim strPath As String Dim objFSO As New FileSystemObject For Each wks In ActiveWorkbook.Worksheets wks.Activate For Each cht In ActiveSheet.ChartObjects strPath = objFSO.GetSpecialFolder(TemporaryFolder) & "\" & cht.Name & ".gif" strImage = strPath gstrImage = strImage cht.Chart.Export strImage, "GIF" Next cht Next wks I have tried to find a way to detect if the chart is previously deleted, because it seems Excel keeps the charts in the collection even if its deleted, but the deleted charts does not show in the Worksheet. How do I do this so that the deleted charts will not be exported? -- _________________ Rolf @ Questus ans |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping Through Charts / ChartObjects | Excel Programming | |||
Looping through charts in a worksheet | Excel Programming | |||
Looping through to stop on pie charts | Excel Programming | |||
Looping Through Charts | Excel Programming | |||
Looping Through Charts | Excel Programming |