Hello,

I am developing an application and I use a 3rd party library which is basically Native excel. The problem is that this library does not implement an event which is able to notify me when the value of a cell value changes. Can I do it in my program and how?

(I thought that I could posible do sth like this :

while(OLDvalue=NEWvalue)
end while
MsgBox("The value has changed")

but this is a very slow procedure so is there a better way or I will have to stick to this)

Recommended Answers

All 4 Replies

The problem with the above statement is this loop will run constantly looking for this new value. You could change this to a timer event where you can set the interval of how often it checks to see if the value has change but again this is something that will run in the background until it either finds the changed value or is explicitily coded to turn off. I prefer not to have things such as this run in the background whenever possibile (although sometimes it may be unavoidable). I'm not sure what your app is doing but if possible I would suggest something where the user clicks a control on your form when there ready to get/save the changes.

Create another class to encapsulate the third party library. This way you will be able to wire up events and handle any business logic when properties are being modified.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.