Excel Undo Method

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
miracle
Posts: 14
Joined: 24 Jan 2020, 12:22

Excel Undo Method

25 Jan 2020, 06:56

Hello there,

i found autohotkey a little while ago and since i am really suprised what all is possible. I still didn't manage to work with classes, call backs or other advanced methods, but i am happy with what i have accomplished so far.

I am currently trying to automate Excel. And since i don't want to rely on Sending items i try to use COM. So far, so good :)

But now i have an dead-end. I want to implement a custom Undo method (https://docs.microsoft.com/en-us/office/vba/api/excel.application.onundo) but i don't find a way to call my method in my ahk file.

Anyone knows how to pass a pointer to a function which resides in my ahk file and not in a excel macro?

Thank you
User avatar
flyingDman
Posts: 2821
Joined: 29 Sep 2013, 19:01

Re: Excel Undo Method

25 Jan 2020, 18:01

Maybe you can be more specific and tell us the exact circumstance in which you would want to use this custom Undo. Give us an example.
14.3 & 1.3.7
User avatar
Xeo786
Posts: 760
Joined: 09 Nov 2015, 02:43
Location: Karachi, Pakistan

Re: Excel Undo Method

28 Jan 2020, 03:59

actually when you make changes on sheet using COM its simply done and can only be undone if you preserve the previous state, and you can imagine how much detail you have to store per step, a excel cell has so many attrib / sub details like value formatting color borders, yah there is possibility but for more precision you have to write so more, and handling excel file with ahk com is enough precision if you know what are you doing,

following macro Jan Karel Pieterse is perfect example to acquire the ability to undo through code
https://jkp-ads.com/Articles/UndoWithVBA00.asp
following download link to excel file having ability to undo stuff done by vba Macro and you can check how limited are they
https://jkp-ads.com/Download.asp#UndoHandler

you need to write ahk classes I think! and I am not well familiar with AHK classes
"When there is no gravity, there is absolute vacuum and light travel with no time" -Game changer theory

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder and 316 guests