Thread: 2002 Vs 2003
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default 2002 Vs 2003


It works for me in both versions.
Are some of the sheets protected in the xl2003 version?
What is the error?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel add-ins)



"Ardy"
wrote in message 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----------------------