Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 92
Default Delete old chartobject and create a new named one?

Hi,

I need a subroutine that delete the old chartobject in a worksheet,
create a new chartobject , name it as I want.

Reason is that if the user delete the chart, I want to recreate it. I
know how to protect it but feel that the user had to be able to change
labels, colors etc.

More than grateful to every suggestion!

Kind regards
tskogstrom

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Delete old chartobject and create a new named one?

Hi,

This will delete a chart object, but not sure how you are identifying
which chart object.

Activesheet.chartobjects(1).delete

' create and give it a name
with Activesheet.chartobjects.add(1,1,400,300)
.name = "MyName"
end with

For more details see Jon's page(s)
http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Cheers
Andy

tskogstrom wrote:
Hi,

I need a subroutine that delete the old chartobject in a worksheet,
create a new chartobject , name it as I want.

Reason is that if the user delete the chart, I want to recreate it. I
know how to protect it but feel that the user had to be able to change
labels, colors etc.

More than grateful to every suggestion!

Kind regards
tskogstrom


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 92
Default Delete old chartobject and create a new named one?

Thank you, Andy
this will help.
/Regards
tskogstrom


Andy Pope skrev:

Hi,

This will delete a chart object, but not sure how you are identifying
which chart object.

Activesheet.chartobjects(1).delete

' create and give it a name
with Activesheet.chartobjects.add(1,1,400,300)
.name = "MyName"
end with

For more details see Jon's page(s)
http://peltiertech.com/Excel/ChartsH...kChartVBA.html

Cheers
Andy

tskogstrom wrote:
Hi,

I need a subroutine that delete the old chartobject in a worksheet,
create a new chartobject , name it as I want.

Reason is that if the user delete the chart, I want to recreate it. I
know how to protect it but feel that the user had to be able to change
labels, colors etc.

More than grateful to every suggestion!

Kind regards
tskogstrom


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


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



All times are GMT +1. The time now is 02:56 PM.

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

About Us

"It's about Microsoft Excel"