Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to delete an embedded chart

Hi,
I am trying to delete an embedded chart from a protected sheet. But i
am getting errors like "select method of chartarea class failed". Can
anyone help?
Here is the code:

Dim ws As Worksheet
Dim chObj As ChartObject
Set ws = ActiveSheet
For Each chObj In ActiveSheet.ChartObjects
chObj.Chart.ChartArea.Select '*** error here
ActiveWindow.Visible = False
Selection.Delete
Next chObj


Thanks
Gunjan Salgia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to delete an embedded chart

Dim ws As Worksheet
Dim chObj As ChartObject
Set ws = ActiveSheet
ws.unprotect
For Each chObj In ActiveSheet.ChartObjects
chobj.Delete
Next chObj
ws.protect

--
Regards,
Tom Ogilvy


Tina wrote in message
om...
Hi,
I am trying to delete an embedded chart from a protected sheet. But i
am getting errors like "select method of chartarea class failed". Can
anyone help?
Here is the code:

Dim ws As Worksheet
Dim chObj As ChartObject
Set ws = ActiveSheet
For Each chObj In ActiveSheet.ChartObjects
chObj.Chart.ChartArea.Select '*** error here
ActiveWindow.Visible = False
Selection.Delete
Next chObj


Thanks
Gunjan Salgia



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete embedded name of author/computer in excel file carlee Excel Discussion (Misc queries) 1 January 21st 10 08:34 AM
How can I delete an embedded checkmark box? MissKathy41 Excel Discussion (Misc queries) 3 April 3rd 09 04:46 AM
Delete embedded chart, how? Boswell Charts and Charting in Excel 1 December 16th 07 07:08 PM
Delete embedded HTML SFJayhawk Excel Discussion (Misc queries) 2 June 8th 06 07:49 PM
how do I delete thousands of pictures that are somehow embedded i. Jim Harris Excel Discussion (Misc queries) 4 February 25th 05 02:24 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"