A
Ardy
Hello All:
I have this code that is for deleting graphs(Charts). Can anybody
tell me why this works in 2002 but gives me error in 2003. for some
reason the 2003 has problem with chObj
Dim ch As Chart, ws As Worksheet
Dim cw As Long, rh As Long
Dim chObj As ChartObject
' ----------------Delete Existing Charts--------------------
Application.DisplayAlerts = False
For Each ch In ActiveWorkbook.Charts
ch.Delete
Next
For Each ws In ActiveWorkbook.Worksheets
For Each chObj In ws.ChartObjects
chObj.Delete
Next
Next
Application.DisplayAlerts = True
' ---------------Delete Existing Charts----------------------
I have this code that is for deleting graphs(Charts). Can anybody
tell me why this works in 2002 but gives me error in 2003. for some
reason the 2003 has problem with chObj
Dim ch As Chart, ws As Worksheet
Dim cw As Long, rh As Long
Dim chObj As ChartObject
' ----------------Delete Existing Charts--------------------
Application.DisplayAlerts = False
For Each ch In ActiveWorkbook.Charts
ch.Delete
Next
For Each ws In ActiveWorkbook.Worksheets
For Each chObj In ws.ChartObjects
chObj.Delete
Next
Next
Application.DisplayAlerts = True
' ---------------Delete Existing Charts----------------------