This project has moved. For the latest updates, please go here.

Support Undo in Excel AddIn

Nov 29, 2011 at 7:30 PM


I 'd like to add Excel native undo feature into my addin.  Is it possible and how? thanks

My addin use C#, VS2010, ExcelDNA, NetOffice

Nov 29, 2011 at 7:42 PM


long time no see, nice to read you again.
the simplest way to use:


*kind regards

Nov 29, 2011 at 8:05 PM
Edited Nov 29, 2011 at 8:08 PM

(Yes,  have been silent for a while :)

oh, I did not make it clear.

I have an Excel UDF, in fact it is not a UDF, more like a process. It has no return value. The process kicks off a web service call based on input parameters asychronously

When getting response back from web service, it will plot result in Excel cells, data could be many rows * columns. After this process, undo button in Excel becomes disabled.  not sure why. So users can't undo previous steps.

I do not want to code undo myself and just want to use Excel built-in undo if possible

Nov 29, 2011 at 8:16 PM
Edited Nov 29, 2011 at 8:19 PM

excel can't undo your own steps of course.
you have implement the undo pattern at hand, not easy i find!
i nice tutorial you find here
these tutorial shows you how create an own undo handler in excel.
the basic idea is: store, the current state and restore with excelApplication.OnUndo();

give me a little bit code and i will see its possible to find a way you can use undo from excel.
display the data is the key, you need a way with undo support. range.Value = "..." doesnt support undo, maybe another way exists here.



Nov 30, 2011 at 2:57 PM

thanks for the info. Will take a look