exceloffice-jsoffice-addinsexcel-addinsexcel-charts

Add Close button to Chart in excel add in


I am working on Excel Add-in and need to show some charts to user. Issue I am facing is that there is no close button on charts and users wants to have some button on chart which can close/hide it. I am unable to find any such option in Office.js and Excel JS API. Can anyone guide me how I can achieve this.


Solution

  • You can't do anything in an add-in that cannot be done by a user through the Excel interface. Since Excel charts don't have a hide/close button, you can't programmatically put such a button charts. The user can remove a chart following the instructions here: https://support.microsoft.com/en-us/office/delete-a-chart-eea1ec2f-fc41-4a8d-ba4b-fcdc7b12d9bf