i'm new to excel addins , i have to hide comments with the help of excel - addins , I have to add one toggle button there , while show/hide the comments , So is there any way I can achieve this functionality.
I Have Read the docs , but don't get any fruitful solution
You can create a custom ribbon UI (commands) with an Excel web add-in. See Create add-in commands in your manifest for Excel, PowerPoint, and Word for more information and samples.
But OfficeJS doesn't provide anything for hiding or showing comments at runtime, however you can add and remove comments programmatically. Read more about that in the Work with comments using the Excel JavaScript API article.
The Excel.CommentCollection class represents a collection of comment objects that are part of the workbook.
The Excel.Comment class represents a comment in the workbook.
As you can see currently that feature is not implemented in OfficeJS. You may consider submitting a request under aka.ms/m365dev-suggestions .