问题描述
如果获取文件时提供了密码,Google Apps脚本是否可以打开受密码保护的Excel文件?我看不到任何接受密码"的DriveApp方法.参数.
Is there a way for Google Apps Script to open a password-protected Excel file if the password is supplied when getting the file? I don't see any DriveApp method that accepts a "password" parameter.
如果没有,那么可以使用Google Drive API来实现吗?是否有一个密码"?我可以在选项"中使用的密钥gapi.client.drive.files.get()的对象还是类似的方法?
If not, then can this be implemented using the Google Drive API? Is there a "password" key I can use in an "options" object of a gapi.client.drive.files.get() or a similar method?
推荐答案
否,目前尚无法使用Apps Script或Google API.
您始终可以在Google的问题跟踪器中提出功能请求,内容类似在驱动器/表格API中支持Excel密码功能".据我所见,目前尚无针对此问题的功能请求.
No, that is not possible with Apps Script or Google APIs at this time.
You can always file a feature request in Google's Issue Tracker with something along the lines of "Support Excel Password functionality in Drive / Sheets API". From what I could see, there are no existing feature requests for this isssue.
我发现Google发布的有关受密码保护的文件的最新消息是此博客文章,其中提到您现在可以预览在云端硬盘中受密码保护的项目.
The latest news that I could find, that Google have published about password protected files is this blog post, which mentions that now you can preview password protected items in Drive.
Google的指南在此处和,详细介绍了可用的功能.但是,它们都不涉及Apps脚本,API或密码.
The guides Google provide here and here regarding Microsoft Office files detail the functionality that is available. Yet none of it refers to Apps Script, APIs or passwords.
我能想到的唯一可能的解决方法是,在将它们上传到云端硬盘之前,先用VBA或其他语言对其进行保护,或者将它们发送到可以处理它们并发送回去的应用程序中(,可能会很痛苦).
The only possible workaround I can think of is to un-protect them with VBA or other language before they are uploaded to Drive, or send them to an app that can deal with them and send them back (I know, that may be painful).
这篇关于使用Google Apps脚本打开受密码保护的Excel吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!