PC Review


Reply
Thread Tools Rate Thread

2002 Vs 2003

 
 
Ardy
Guest
Posts: n/a
 
      18th Jun 2007
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----------------------

 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      18th Jun 2007

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" <(E-Mail Removed)>
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----------------------

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      18th Jun 2007
I just tested this in 2003. Should do it all

sub deleteallcharts()
For Each ws In ActiveWorkbook.Worksheets
For Each chObj In ws.ChartObjects
chObj.Delete
Next
Next
end sub
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Ardy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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----------------------
>


 
Reply With Quote
 
Ardy
Guest
Posts: n/a
 
      18th Jun 2007
On Jun 18, 12:09 pm, "Jim Cone" <jim.cone...@rcn.comXXX> wrote:
> 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, USAhttp://www.realezsites.com/bus/primitivesoftware
> (Excel add-ins)
>
> "Ardy" <a...@totlsolution.com>
> 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----------------------


Thanks for reply:
I don't have access to the 2003 version, It is my home version. I
will post the error as soon as I get home today. And yes there are
some protected sheet, but prior to deleting I am unlocking.......I
will post today with error.

 
Reply With Quote
 
Ardy
Guest
Posts: n/a
 
      19th Jun 2007
On Jun 18, 12:24 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> I just tested this in 2003. Should do it all
>
> sub deleteallcharts()
> For Each ws In ActiveWorkbook.Worksheets
> For Each chObj In ws.ChartObjects
> chObj.Delete
> Next
> Next
> end sub
> --
> Don Guillett
> SalesAid Software
> dguille...@austin.rr.com"Ardy" <a...@totlsolution.com> wrote in message
>
> news:(E-Mail Removed)...
>
> > 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----------------------


OK
I get the compile error, can't find project or library, I don't
understand why I don't get this with 2002 version. any thoughts.......

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      19th Jun 2007
In the VBE, go to Tools > References, and look for one that's labeled
"MISSING". Uncheck the reference and try again.

Very often things seemingly unrelated to a missing reference will fail.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Ardy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Jun 18, 12:24 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
>> I just tested this in 2003. Should do it all
>>
>> sub deleteallcharts()
>> For Each ws In ActiveWorkbook.Worksheets
>> For Each chObj In ws.ChartObjects
>> chObj.Delete
>> Next
>> Next
>> end sub
>> --
>> Don Guillett
>> SalesAid Software
>> dguille...@austin.rr.com"Ardy" <a...@totlsolution.com> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>> > 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----------------------

>
> OK
> I get the compile error, can't find project or library, I don't
> understand why I don't get this with 2002 version. any thoughts.......
>



 
Reply With Quote
 
Ardy
Guest
Posts: n/a
 
      19th Jun 2007
On Jun 19, 5:46 am, "Jon Peltier" <jonxlmv...@SPAMpeltiertech.com>
wrote:
> In the VBE, go to Tools > References, and look for one that's labeled
> "MISSING". Uncheck the reference and try again.
>
> Very often things seemingly unrelated to a missing reference will fail.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. -http://PeltierTech.com
> _______
>
> "Ardy" <a...@totlsolution.com> wrote in message
>
> news:(E-Mail Removed)...
>
> > On Jun 18, 12:24 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> >> I just tested this in 2003. Should do it all

>
> >> sub deleteallcharts()
> >> For Each ws In ActiveWorkbook.Worksheets
> >> For Each chObj In ws.ChartObjects
> >> chObj.Delete
> >> Next
> >> Next
> >> end sub
> >> --
> >> Don Guillett
> >> SalesAid Software
> >> dguille...@austin.rr.com"Ardy" <a...@totlsolution.com> wrote in message

>
> >>news:(E-Mail Removed)...

>
> >> > 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----------------------

>
> > OK
> > I get the compile error, can't find project or library, I don't
> > understand why I don't get this with 2002 version. any thoughts.......


Thanks Jon:
I will try this tonight as soon as I get home, I hope this works. I
will post toinight if this worked.

 
Reply With Quote
 
Ardy
Guest
Posts: n/a
 
      20th Jun 2007
On Jun 19, 5:46 am, "Jon Peltier" <jonxlmv...@SPAMpeltiertech.com>
wrote:
> In the VBE, go to Tools > References, and look for one that's labeled
> "MISSING". Uncheck the reference and try again.
>
> Very often things seemingly unrelated to a missing reference will fail.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. -http://PeltierTech.com
> _______
>
> "Ardy" <a...@totlsolution.com> wrote in message
>
> news:(E-Mail Removed)...
>
> > On Jun 18, 12:24 pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> >> I just tested this in 2003. Should do it all

>
> >> sub deleteallcharts()
> >> For Each ws In ActiveWorkbook.Worksheets
> >> For Each chObj In ws.ChartObjects
> >> chObj.Delete
> >> Next
> >> Next
> >> end sub
> >> --
> >> Don Guillett
> >> SalesAid Software
> >> dguille...@austin.rr.com"Ardy" <a...@totlsolution.com> wrote in message

>
> >>news:(E-Mail Removed)...

>
> >> > 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----------------------

>
> > OK
> > I get the compile error, can't find project or library, I don't
> > understand why I don't get this with 2002 version. any thoughts.......


Worked, Thanks a bunch. Can you explain what this option is
for..........

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2002-2003 db combo boxes not working when opened with access 2002 laskowv Microsoft Access 1 7th Jul 2009 02:42 AM
Problems with 2002 access users using an MDE file format 2002-2003 =?Utf-8?B?S1JC?= Microsoft Access 3 25th Jul 2006 03:58 PM
Diiference in threading on PPC 2002 and PPC 2003? ( Deadlock onPPC 2002, runs fine on PPC 2003. ) Jan Obrestad Microsoft Dot NET Compact Framework 2 3rd Apr 2006 07:57 PM
File Format 2002 versus 2002-2003 =?Utf-8?B?V2F5bmUgUmFuZGFsbA==?= Microsoft Frontpage 2 13th Sep 2005 11:31 AM
Access 2003 & 2002 versus 2002 Razor Microsoft Access 2 1st Nov 2003 05:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 PM.