Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Office Undo... Export to Array?

Posted on 2014-03-04
3
Medium Priority
?
426 Views
Last Modified: 2014-03-05
Hi All

I am wondering if it is possible to export the undo history from MS Word / MS Excel and if there is simple (fast) code to achieve this.

I would be happy to fill an array / scripting dictionary / table with the descriptions of the available Undo Actions.

Any thoughts on how to achieve?

Kind regards,
0
Comment
Question by:DrTribos
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 2000 total points
ID: 39905586
The undo buffer is not available to us via the application object model so, no, you can't export it or access it in any way.

This has been a bone of contention with Microsoft for years as it makes controlling the undo buffer impossible. Did you know that the entire buffer is cleared when certain properties are set or methods invoked from VBA?

Kevin
0
 
LVL 15

Author Comment

by:DrTribos
ID: 39905607
Thank you for your comments, explains why I keep hitting a brick wall!

No I did not know that, can you provide a few examples?
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39905652
Basically setting any worksheet property or invoking a method that changes a worksheet will reset (clear) the undo buffer. An example is accessing the UsedRange object. Any time the Worksheet.UsedRange property is accessed, the undo buffer is cleared.

This makes sense if you think about it. The undo buffer contains specific instructions to undo user actions. If VBA code executes and starts monkeying with the worksheet, that runs the risk of rendering the undo buffer's instructions obsolete. Rather than write mountains of logic to handle all possible cases - or record every VBA invoked worksheet change in the buffer, Microsoft chose to just clear the buffer when ANY worksheet property is changed from VBA. Easy solution to a very difficult problem.

Kevin
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question