Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

Google Apps Script to open password-protected Excel?

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...