question

VikramKumar-4569 avatar image
0 Votes"
VikramKumar-4569 asked YunfanChen-3146 edited

Application.CutCopyMode is not available in Excel office.js API. How can I stop paste values in cells in Excel Web Addin

I am working on a web addin using Office.js API. When I paste values in an range from external Excel file, the existing conditional formatting and other formatting get changed. I have two options; 1. Stop paste from external source and 2. Remove formats of source data and paste only values in the cells range. Please help/suggest me how I can perform these actions.

office-addins-devoffice-scripts-excel-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YunfanChen-3146 avatar image
0 Votes"
YunfanChen-3146 answered YunfanChen-3146 edited

To my knowledge, CutCopyMode in excel addin is not supported now. You could go to Microsoft 365 Developer Platform Ideas Forum to see if this feature has already been requested or request a new feature.

I would give you two workarounds.

  1. Set this sheet as protected. If user want to make change, only by your addin. (For the mainly read scenario)

  2. Clean and re-apply the conditional format manually or periodically. Use range.clear("Formats") and apply the conditional format again.

Thanks.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.