Sorry I have so many questions.
Is there any way to determine if a value in a cell has changed?
GH
Dim originalSheet(,) As String
Private Sub LoadFile_Click(sender As Object, e As EventArgs) Handles LoadFile.Click
Dim ofDialog As OpenFileDialog = New OpenFileDialog()
ofDialog.Filter = "All files|*.*|Micellosoft Excel Files(*.xls;*.xlsx;*.ods;*.xlsb)|*.xls;*.xlsx;*.xlsb;*.ods"
If ofDialog.ShowDialog() = DialogResult.OK Then
Spreadsheet1.LoadFromFile(ofDialog.FileName)
Dim sheet As IWorksheet = Spreadsheet1.ActiveWorksheet
Dim col As Integer = sheet.ColumnCount
Dim row As Integer = sheet.RowCount
ReDim originalSheet(row, col)
Dim i As Integer = 0
Do While (i < row)
Dim j As Integer = 0
Do While (j < col)
If (Not (sheet(i, j).Value) Is Nothing) Then
originalSheet(i, j) = sheet(i, j).Value.ToString
End If
j = (j + 1)
Loop
i = (i + 1)
Loop
End If
End Sub
Private Sub CheckCell_Click(sender As Object, e As EventArgs) Handles CheckCell.Click
Dim sheet As IWorksheet = Spreadsheet1.ActiveWorksheet
Dim cell As CellAdressInfo = sheet.ActiveCellAdressInfo
If (Not (sheet(cell.Row, cell.Column).Value) Is Nothing) Then
If Not sheet(cell.Row, cell.Column).Value.ToString.Equals(originalSheet(cell.Row, cell.Column)) Then
MessageBox.Show("cell has changed !!!")
Else
MessageBox.Show("cell has not changed !!!")
End If
ElseIf (Not (originalSheet(cell.Row, cell.Column)) Is Nothing) Then
MessageBox.Show("cell has changed !!!")
Else
MessageBox.Show("cell has not changed !!!")
End If
End Sub