ctkrohn
ctkrohn

Reputation: 63

Any way to save and recover undo history in VBA?

When you run a VBA macro under Excel, it erases the undo history. Is there any way to prevent this? I'd like to capture the undo history before running my macro, and restore it after my macro is finished. I didn't notice anything in the Excel documentation that looked promising.

Upvotes: 1

Views: 2535

Answers (1)

Chris Rae
Chris Rae

Reputation: 5675

There is no way to keep undo history in an Excel macro (there is in a Word macro, so VBA itself has the hooks, which makes it a confusing business). Whenever the VBA launches, Excel kills the undo stack.

Upvotes: 2

Related Questions