ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting chart objects (https://www.excelbanter.com/excel-programming/327618-protecting-chart-objects.html)

[email protected]

Protecting chart objects
 
I would appreciate any suggestions. I have a question concerning
protected charts.

I am currently creating charts on a worksheet, a different chart
depending upon the option button the user selects. I was told to make
sure that the user can not select the chart, move the chart, delete the
chart. I am creating my charts in a particular range. So when the
user selects an option button for a different chart ... the previous
chart object is deleted, and a new one is created and placed in the
range. How can I protect each chart, considering the creation and
removal of charts going on in my workbook?

Thanks in advance,
Julia


Tom Ogilvy

Protecting chart objects
 
In your code,
unprotect the sheet,
delete the old chart
build the new chart
protect the sheet (at least for objects)


Charts are on the object layer, so you have to at least protect objects.

--
Regards,
Tom Ogilvy

wrote in message
ups.com...
I would appreciate any suggestions. I have a question concerning
protected charts.

I am currently creating charts on a worksheet, a different chart
depending upon the option button the user selects. I was told to make
sure that the user can not select the chart, move the chart, delete the
chart. I am creating my charts in a particular range. So when the
user selects an option button for a different chart ... the previous
chart object is deleted, and a new one is created and placed in the
range. How can I protect each chart, considering the creation and
removal of charts going on in my workbook?

Thanks in advance,
Julia




[email protected]

Protecting chart objects
 
Thanks for the response. Would the following suffice?

ActiveSheet.Protect DrawingObjects:= True ' To protect chart object

And I am assuming I would change the above to false to unprotect? If I
am incorrect would you mind to point me in the right direction?

Thanks


Mike Fogleman

Protecting chart objects
 
Julia, you will need to Protect Objects after you create a chart and then
Unprotect Objects before you delete it.

Mike F
wrote in message
ups.com...
I would appreciate any suggestions. I have a question concerning
protected charts.

I am currently creating charts on a worksheet, a different chart
depending upon the option button the user selects. I was told to make
sure that the user can not select the chart, move the chart, delete the
chart. I am creating my charts in a particular range. So when the
user selects an option button for a different chart ... the previous
chart object is deleted, and a new one is created and placed in the
range. How can I protect each chart, considering the creation and
removal of charts going on in my workbook?

Thanks in advance,
Julia




[email protected]

Protecting chart objects
 
Would you mind to share a code sample with me? Any help is
appreciated.

Thanks


Tom Ogilvy

Protecting chart objects
 
That would be it.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Thanks for the response. Would the following suffice?

ActiveSheet.Protect DrawingObjects:= True ' To protect chart object

And I am assuming I would change the above to false to unprotect? If I
am incorrect would you mind to point me in the right direction?

Thanks





All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com