1
votes

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.

2
What on earth is a "dirty cell"? I'm afraid to even google that at work. - Samuel Hulla
If a cell is edited by value or format, that became dirty. So I need to find, what are all the cells are dirty(edited) from range of cells. - Raghu
A safer google from work: "IsDirty" as that's the proper syntax in most coding standards. - Denise Skidmore

2 Answers

0
votes

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.

0
votes

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.