Protecting embedded MS Excel graphs with a password

I would like to protect a worksheet in MS Excel. It is rather easy to protect the cells, but the graphs don’t work anymore. The grapsh are created with VBA.
Frans_TruyensAsked:
Who is Participating?
 
Rory ArchibaldCommented:
All you need to do is right-click the chart, choose Format Chart Area, then in the Properties section, uncheck the Locked property.
0
 
Rob HensonFinance AnalystCommented:
As the graphs are created in VBA, unprotect the sheet at the start of the routine and then protect it again at the end of the routine.

Thanks
Rob H
0
 
Frans_TruyensAuthor Commented:
How do I unprotect an embedded chart?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Rob HensonFinance AnalystCommented:
How is the chart getting embedded and protected?

I am not aware of a means of protecting a chart other than by protecting the sheet that it is on.
0
 
Frans_TruyensAuthor Commented:
It is a complex MS Excel sheet with VBA behind it. When clicked on buttons, it needs to be unprotected, and protected again. I will try. I will keep you informed.
0
 
Frans_TruyensAuthor Commented:
No. THis is not possible. I need the double-click on the embedded charts. And the double-click doesn't work when the chart is protected. I need to protect the sheet, the cells I mean, and unprotect the embedded charts
0
 
Rob HensonFinance AnalystCommented:
In the Protect Sheet Pop-up there is a list of activities that are allowed when the sheet is protected. One of these is Edit Objects. If you tick that option the chart on the sheet is still selectable.

Thanks
Rob H
0
 
Frans_TruyensAuthor Commented:
It is not that easy. When I do that, I cannot run my code. I need to be able to run the code, to update the charts. Either I don't lock the graphs, either I cannot update them. It is not that easy
0
 
Rory ArchibaldCommented:
I think you need to be more specific. Why can't you run your code? What happens?
0
 
Frans_TruyensAuthor Commented:
The code is first deleting the previous chart, the contents of it. eg. de bars of the barchart. When I lock the graph, I can't delete the bars of the barchart.
0
 
Rory ArchibaldCommented:
Again, your code should unprotect the sheet, do what it needs to do, then reprotect the sheet.
0
 
Frans_TruyensAuthor Commented:
Problem is, when protected, the graphs should support the double-click event.
0
 
Rory ArchibaldCommented:
How are you intercepting that when they aren't protected?
0
 
Frans_TruyensAuthor Commented:
Indeed. I intercept the double-click event of the barcharts, I have written code for that. When they double-click on a barchart, or linechart, they jump to another sheet.
0
 
Frans_TruyensAuthor Commented:
I am working with Excel 365. I don't find that checkbox
0
 
Frans_TruyensAuthor Commented:
I found!! I will try it.
0
 
Frans_TruyensAuthor Commented:
It works. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.