Google Apps Script to open password-protected Excel?

丶灬走出姿态 提交于 2021-02-16 18:21:08

问题


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.

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?


回答1:


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.


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.

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.

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).



来源:https://stackoverflow.com/questions/64377823/google-apps-script-to-open-password-protected-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!