Find the dirty(edited) cell/cells from excel sheet using Excel JavaScript API

匆匆过客 提交于 2019-12-08 03:40:15

问题


I am using office 365 and Excel online (Build 16.0.9403.1875).

and I am creating Microsoft Excel online Add-ins, using Excel javascript API.

How to find the dirty cell/cells from excel sheet using Excel Javascript API.

If a cell is edited by value / formula / format, that became dirty. So I need to find, what are all the cells are dirty(edited) from range of cells.

For Reference, Please find

calculate

method in this link.

Advance Thanks.


回答1:


There is no Excel JavaScript API that will return the dirty cells, but it's a good idea. Please suggest it at Office Developer Voice.




回答2:


Since Excel doesn't natively have a dirty flag, you'll need to produce one via one of two methods:

Catch the cell edit event and record a list of edited cells that are dirty.

Dim Dirty As New Collection

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim sheet As Worksheet
    Set sheet = Sh
    Dirty.Add (sheet.Name + "!" + Target.Address)
End Sub

OR

When you need the dirty flag, open the saved copy behind the scenes and compare the two to see what has changed.



来源:https://stackoverflow.com/questions/50817709/find-the-dirtyedited-cell-cells-from-excel-sheet-using-excel-javascript-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!