|
-
Sep 19th, 2005, 12:13 PM
#1
Thread Starter
Frenzied Member
undo option is not working in MS excel
Hi all,
I created some macros in my excel sheet. After creating the macros the undo option is unavailable. I don't know why?
Let me know your suggestions.
Thanks,
CS.
-
Sep 19th, 2005, 12:23 PM
#2
Re: undo option is not working in MS excel
Macro changes are not "undo-able". Macros can clear all items from the undo list too.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 19th, 2005, 12:30 PM
#3
Thread Starter
Frenzied Member
Re: undo option is not working in MS excel
That's what I am telling? How to avoid that?
CS.
-
Sep 19th, 2005, 12:34 PM
#4
Re: undo option is not working in MS excel
You cant. Manual changes can be undone but not all, like almost any menu item click or action. You would have to write code to log what changes your macro code makes and basically create your own undo log for macros.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 19th, 2005, 12:38 PM
#5
Thread Starter
Frenzied Member
Re: undo option is not working in MS excel
How can I do that?
Give me some tips/code.
Thanks,
CS.
-
Sep 19th, 2005, 01:09 PM
#6
Re: undo option is not working in MS excel
Ok, say your macro procedure is adding a row, you would write out to a hidden sheet or a text file something like "Insert row at row 3" if your code added a row at row 3. This would allow you to go back and delete that row since you know the action and place. You may even want to write it as parameters for a UndoMacro procedure type thing.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 19th, 2005, 01:15 PM
#7
Re: undo option is not working in MS excel
Or you could .....
1/ save a copy of your workbook as a temp file.
2/ run your code.
3/ Show user the outcome and ask if they want to keep the changes.
3a/ If yes then delete the temp file.
3b/ If no then copy temp file back into the original.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Sep 19th, 2005, 01:21 PM
#8
Re: undo option is not working in MS excel
A good suggestion DKenny as long as the closing and opening interruption is acceptable then that is the solution I would recommend.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 19th, 2005, 01:24 PM
#9
Re: undo option is not working in MS excel
In fact, you may not even need to save it as a temp file, just make a copy of the file in the active instance, use it if necessary and then close without saving. - Depends on the size of the file, etc...
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|