Reputation: 30926
Why are my excel addin actions not undoable? How can I get them to register so a user who runs the script has the ability to undo?
My addin writes data to cells and overwrites data if it exists however once written I can't undo/
Upvotes: 1
Views: 293
Reputation: 4889
Have you read through this discussion
http://www.vbforums.com/archive/index.php/t-288722.html
Basically, invoking a macro clears all the undo events in Excel. If you think about it, that makes some amount of sense, since only the macro could know specifically how to undo it's actions (as in, the macro might do things to the file system or a DB that Excel couldn't possibly undo).
But that thread goes on to describe how to add your own undo events to the undo stack. You have to code up the "undo" action yourself, but it is doable.
Upvotes: 2