exceloffice-jsoffice-addinsexcel-addinsexcel-charts

How to make Excel Chart read-only


I am working on an Excel add-in and need to show charts to users. However when I open a chart programmatically, users can change its heading/legends/color etc. I want to restrict user from doing so. Is there a way to make charts read-only?


Solution

  • Excel does not support making a chart read-only if the user has editing permission to the worksheet, so you can't do this in an add-in either. You might be able to achieve your scenario by making the worksheet on which the chart appears read-only. You do that by calling the Excel.worksheetprotection.protect() method.