简体   繁体   English

忘记保存Excel宏

[英]Forget to save excel macro

I was working on an excel macro and apparently I did not saved with a format that support vba macros. 我正在使用excel宏,显然我没有使用支持vba宏的格式进行保存。 So when I open the file I cannot found the vba code. 因此,当我打开文件时,找不到vba代码。 Is there a way to restore the code I wrote, especially that I pushed the save button in the editor several times during the core writing ? 有没有一种方法可以还原我编写的代码,特别是在核心编写过程中多次按下编辑器中的“保存”按钮?

I would be grateful if you can save my 4 hours work. 如果您可以节省4个小时的工作,我将不胜感激。

You lost your work. 你丢了工作

The good news? 好消息? Every time I had to re-write a piece of code, the 2nd time around was consistently much better than the first. 每次我不得不重新编写一段代码时,第二次总是比第一次更好。 So, take that lost work as an opportunity! 因此,以失去的工作为契机!


Unless... it's possible you have Excel's autosave feature turned on: 除非...可能打开了Excel的自动保存功能:

Excel选项/保存

Look under %appdata%\\Microsoft\\Excel ; %appdata%\\Microsoft\\Excel下查看; with a little luck you'll find a copy of your work saved as a .xlsb file, and all you'll have lost is 10 minutes of work. 运气好的话,您会发现保存为.xlsb文件的工作副本,而您丢失的只是10分钟的工作。 If you're lucky. 如果幸运的话。

That said... 那个...

I pushed the save button in the editor several times during the core writing 在编写核心过程中,我几次按下编辑器中的“保存”按钮

The VBE doesn't do the saving. VBE不会保存。 If you bring up the VBE in a brand new unsaved workbook and hit the VBE's [Save] button, what happens is that the VBE invokes the host application's save mechanism, and thus Excel prompts you for a file name . 如果您在未保存的全新工作簿中打开VBE并单击VBE的[保存]按钮,则发生的情况是VBE调用了宿主应用程序的保存机制,因此Excel会提示您输入文件名

If you really hit the [Save] button several times in the editor, either you did save your work, or you explicitly cancelled the "Save As" dialog that popped up every time - in which case your work is indeed lost. 如果您确实在编辑器中多次单击[保存]按钮,则您确实保存了工作,或者明确取消了每次都会弹出的“另存为”对话框-在这种情况下,您的工作确实丢失了。

If you did hit that [Save] button and Excel didn't prompt you for a file name, then you did save it. 如果您确实点击了[保存]按钮,而Excel没有提示您输入文件名,则您确实保存了该文件名。 Try looking for it in Excel's recent documents . 尝试在Excel的最新文档中查找它。

And hit Ctrl + S more than once every 4 hours! 每4小时不止一次按下Ctrl + S

Short answer: No 简短答案:

Long answer: If you can run fast, by breaking the speed of light, you would be able to turn back time, thus you would be able to go in the past and save your file correctly. 长答案:如果您可以通过打破光速来快速运行,则可以倒转时间,因此您可以过去并正确保存文件。

Answer bringing some value : 带来一些价值的答案

  • No, but make sure that you enable autosave next time. 不,但是请确保下次启用自动保存。
  • Make a habit of saving manually every 10 minutes. 养成每10分钟手动保存一次的习惯。
  • Start using version control system, where you commit every time you have something new - Best way to do Version Control for MS Excel 开始使用版本控制系统,每次有新内容时都在其中提交- 进行MS Excel版本控制的最佳方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM