Alex Piotto
Board Regular
- Joined
- Jul 5, 2016
- Messages
- 82
- Office Version
- 2007
- Platform
- Windows
Hi everybody!
I have a book with some macros that will move data between sheets. As it is almost impossible to undo a macro job, i need a fail safe.
After scavenging online, I made a button with a script that will close the book without saving, and in theory should open it again.
Here goes the simple script...
Sure is that the book will close without saving but it is clear that it will not open again (and it do not open actually) since the macro stops when the book closes.
Any workaround?
I have a book with some macros that will move data between sheets. As it is almost impossible to undo a macro job, i need a fail safe.
After scavenging online, I made a button with a script that will close the book without saving, and in theory should open it again.
Here goes the simple script...
VBA Code:
Private Sub UNDOBUTTON_Click()
x = ActiveWorkbook.Name
Workbooks(x).Close savechanges:=False
Workbooks.Open Filename:=ActiveWorkbook.Path & x
End Sub
Sure is that the book will close without saving but it is clear that it will not open again (and it do not open actually) since the macro stops when the book closes.
Any workaround?