强制另存为,MS Excel VBA [英] Force Save As, MS Excel VBA
问题描述
基本上,我有这样的:
- 用户打开.xls,将一些数据输入一些字段,然后将文件 - >另存为他们自己的位置
- 有时用户点击保存,因此覆盖了我不想发生的.xls。
我一直在研究一些想法,但我不知道如何最好地实现它,我认为用户首次打开.xls以保存到新位置时的提示是最好的方法,但是如果他们已经将文件保存到新的位置并决定编辑新的位置,我希望他们能够在这一点上保存,因为现在它是自己的文件,而不是原始文件。
如果有人可以指出我的方向或找到我的逻辑缺陷,我很乐意听到。
谢谢,
Mike
我用作模板(但它不是一个实际的模板文件类型)
最简单的方法是使用保存文件只读推荐
设置为true。查看快照
即使用户尝试执行保存
,Excel也会自动提示输入另存为
HTH
I'm a bit of a newby with VBA in MS Office products. I've been searching for some code that will force a user to "Save As' a .xls file I use as a template (but it's not an actual template file type)
Basically, I have this:
- User opens .xls, enters some data into some field and then File-->Save As to their own location
- Sometimes user clicks save instead, therefore overwriting the .xls which I don't want to happen.
I've been looking into some ideas, but I'm not sure how to implement it the best. I think a prompt when the user first opens the .xls to save to a new location is the best approach, but thinking forward, if they have already saved the file to a new location and decide to edit the new one, I want them to be able to 'Save' at that point because now it is their own file, not the original.
If someone can point me in the right direction or find flaws in my logic, I'd love to hear it.
Thanks, Mike
I use as a template (but it's not an actual template file type)
The most simplest way is to save the file with Read-Only Recommended
set to true. See the snapshot
That ways even if the user tries to do a Save
, Excel will automatically prompt for a Save As
HTH
这篇关于强制另存为,MS Excel VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!