简体   繁体   中英

How can I detect cell text changing in VSTO add-in with C#?

I want to use an event or something what is fired when I am typing in the cell. I tried SheetChange and SelectionChange events, which were not I need. Both of them are fired after things changed. Is there any way I can fire a event when I'm editing in a cell? Like some controls that have XXXEditing/XXXChanging events?

There is no event against changing cell that starts before changing it.

  • change event fires after you have changed the content of the cel
  • selectionchange event fires when you change the selection

At least, you can detect when the cell is in "Edit mode", ie is accepting input, see:

https://www.codeproject.com/Articles/20267/Determining-if-Excel-is-in-Edit-mode

But you won't be able to detect when the user is typing anything, unless you are willing to use dirty Win32 API tricks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM