Excel - Application.GetSaveAsFilename提示只读文件

时间:2022-05-24 22:37:19

I've just upgraded to Excel 2010 from 2003. An internal add-in that is heavily used uses the Application.GetSaveAsFilename method to prompt for file names to be used for an export process (exporting information from the current Excel file into an xml configuration file).

我刚刚从2003年升级到Excel 2010.大量使用的内部加载项使用Application.GetSaveAsFilename方法来提示用于导出过程的文件名(将信息从当前Excel文件导出到xml配置中)文件)。

In 2003, even if they selected a Read Only file, I didn't get any prompts (which is what I want) leaving it up to me to handle read-only issues (which I do...e.g. I check the file out of source control). However, after upgrading to 2010, I can't select a filename if that file exists and is readonly, forcing me to manually go checkout files first (which is a major downer in terms of proficiency when I'm exporting ~60 files per day).

在2003年,即使他们选择了只读文件,我也没有得到任何提示(这就是我想要的)让我处理只读问题(我这样做...例如我检查文件源控制)。但是,在升级到2010之后,我无法选择文件名,如果该文件存在并且是只读的,则迫使我首先手动输入结帐文件(当我每天导出~60个文件时,这是一个主要的熟练程度)。

Does anyone know of any settings/workarounds so that Excel 2010 doesn't prevent (or even prompt hopefully) selecting a filename of a previously existing/readonly file?

有没有人知道任何设置/变通方法,以便Excel 2010不会阻止(甚至提示有希望)选择以前存在/只读文件的文件名?

Thanks in advance.

提前致谢。

1 个解决方案

#1


2  

Does it help if you use Application.GetOpenFilename instead?

如果您使用Application.GetOpenFilename会有帮助吗?

Sub PromptForFilename()
    ret = Application.GetOpenFilename
    MsgBox ret
End Sub

This doesn't give me any errors for a read-only file.

对于只读文件,这不会给我任何错误。

#1


2  

Does it help if you use Application.GetOpenFilename instead?

如果您使用Application.GetOpenFilename会有帮助吗?

Sub PromptForFilename()
    ret = Application.GetOpenFilename
    MsgBox ret
End Sub

This doesn't give me any errors for a read-only file.

对于只读文件,这不会给我任何错误。