Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Office.context.document.getFileAsync() fails in some Excel clients #757

Closed
tiagoalves opened this issue Oct 4, 2019 · 18 comments
Closed
Assignees
Labels
Area: Excel Issue related to Excel add-ins

Comments

@tiagoalves
Copy link

As asked in this SO question, when my Excel add-in tries to fetch the whole OOXML zip file with the code:

Office.context.document.getFileAsync(Office.FileType.Compressed, {
  sliceSize: 65536
}, callback);

Some users are getting the error:

{"name":"Permission Denied","message":"You don't have sufficient permissions for this action.","code":7000}

Expected Behavior

Calling this method should return the XLSX file successfully in all Excel 2016 or later for Windows and macOS.

Current Behavior

The error seems to only occur in Excel clients with the exact version 16.0.0000.0000. In more recent Excel clients the call is successful.

Steps to Reproduce, or Live Example

I was not able to reproduce the error myself. I only know that it happens to some users of my add-in because I have integrated a central error catching/reporting tool and saw it there.

Context

More than a fix, I would like to understand:

  • To what Excel release on Windows does version 16.0.0000.0000 correspond so that I can try to reproduce it?
  • Is there any known situation in which Permission Denied occurs when reading the document file with Office.context.document.getFileAsync()?

Your Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: 16.0.0000.0000
  • Operating System: Windows 10
  • Browser (if using Office Online): The Excel embedded WebView is IE11

Useful logs

I have no other logs other than the error JSON provided above.

@ghost ghost added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Oct 4, 2019
@peronald peronald added Area: Excel Issue related to Excel add-ins Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Oct 4, 2019
@kbrandl kbrandl added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Oct 8, 2019
@catchingyu catchingyu assigned catchingyu and unassigned tutieu Oct 12, 2019
@catchingyu
Copy link

Thanks a lot for reaching us. Since it is not reproducible, could you help on more questions below:

How often does your customers encounter this permission issue?
Is it happening on specified customers or randomly happens on different customers?
Is it possible that you could reach out your customers and get their files/environment and reproduce the issue?

@kbrandl kbrandl added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Oct 12, 2019
@hungvnguyen-kms
Copy link

Hi, currently I found that Excel on iPad doesn't support getFileAsync() function because when I logged it, it is 'undefined'. Is that true?
I have checked the requirement sets from here https://docs.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/office-add-in-requirement-sets#file. It says that Excel on iPad supports this function, but in all of three FileType (Compressed, Pdf and Text) there is no mention about Excel on iPad.
Please help me to confirm this.

@tiagoalves
Copy link
Author

@catchingyu, here are the answers to your questions:

How often does your customers encounter this permission issue?

My users encounter this issue when they're evaluating my add-in and either try again (and encounter the error again) or they simply give up.

Is it happening on specified customers or randomly happens on different customers?

It happens to different customers. But they all seem to be using the same Excel environment:

  • PC, Windows 10 (I don't know the exact release)
  • Excel 16.0.0000.0000 with IE11 WebView.

Is it possible that you could reach out your customers and get their files/environment and reproduce the issue?

I contacted the users that were affected by this issue but none of them replied.

@catchingyu, I'd like to ask you the following questions:

  • To what Excel release on Windows does version 16.0.0000.0000 correspond so that I can try to reproduce it?
  • Is there any known situation in which Permission Denied occurs when reading the document file with Office.context.document.getFileAsync()?

@ghost ghost added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Oct 16, 2019
@catchingyu
Copy link

@tiagoalves have you reproduced the issue with the latest Excel Version. Is it possible you could have the screen shoot from your customer with the version info under the 'Account' tab?

image

If you can reproduce it, then it would be more helpful for us to identify the issue.

@tiagoalves
Copy link
Author

@catchingyu I was never able to reproduce it with the latest Excel version for Mac nor for Windows. I also tried with Windows 10 pre-1903 and with Office 2016 Pro Plus with and without the latest updates.

I already asked my customers to tell me which version of Excel they use but no one responded.

I understand that this issue is not easy for the Office team to act on so feel free to close it.

However, before you do, I would truly appreciate if you could answer the questions I already asked twice:

  • To what Excel release on Windows does version 16.0.0000.0000 correspond so that I can try to reproduce it?
  • Is there any known situation in which Permission Denied occurs when reading the document file with Office.context.document.getFileAsync()?

@collinstowell
Copy link

I can confirm and further explain the issue (not the solution unfortunately). I believe that the core of the issue is that the original volume license versions of Office 2016 are limited to version 16.0.4966 and earlier. Unfortunately this still represents a good portion of the market, so we're stuck dealing with these legacy issues until the vast majority of the user base upgrades to 365/19.

So for some strange reason, on 16.0.4966, every call to getFileAsync results in that error code above (Permission Denied with the 7000 code). I've tried with various settings in the manifest but no luck with any of the settings. Any ideas or suggestions here? I'd hate to tell a good portion of our user base that our add-in won't be available to them.

@MandytMSFT
Copy link

@hungvnguyen-kms From the official document,GetFileAsync should be supported on ipad. Could you share you code and your excel version to us ? Besides, i'd like to suggest you to create a new GitHub query in order we can handle it timely(Mixing with other query is easy to be lost :()

@MandytMSFT
Copy link

MandytMSFT commented Apr 19, 2020

@collinstowell did you try isSetSupported check in your addin ? you can refer the official doc here: https://docs.microsoft.com/en-us/javascript/api/office/office.requirementsetsupport?view=word-js-preview
For GetFileAsync, it depends which fileType you are supporting, the requirement set mapping is here: https://docs.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/office-add-in-requirement-sets

For example, if you are supporting PdfFile, then the check is something like: isSetSupported("PdfFile").

Pls try to see if your issue can resolve. If not, i'd like to suggest you create a new github thread. I'd like to focus the issue tiagoalves reported in this thread

@MandytMSFT
Copy link

@tiagoalves as collinstowell mentioned, this may cause by your addin running on unsupported office version. Do you have isSetSupported check in your addin ?

@MandytMSFT MandytMSFT added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Apr 27, 2020
@ghost ghost added the Status: no recent activity Issue or PR is stale (no recent activity) label May 1, 2020
@ghost
Copy link

ghost commented May 1, 2020

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

@tiagoalves
Copy link
Author

@MandytMSFT I am checking isSetSupported for different APIs but not for this particular one: Document.getFileAsync with Office.FileType.Compressed.

I didn't really understand how to check if that API is supported but apparently it's like this:

Office.context.requirements.isSetSupported("CompressedFile")

I'll add this to our add-in and see if that mitigates the issue.

However, I assumed these Common APIs with version 1.1, such as getFileAsync with file type Compressed, were always available in all hosts since 2016 and later.

@ghost ghost removed Status: no recent activity Issue or PR is stale (no recent activity) Needs: author feedback Waiting for author (creator) of Issue to provide more info labels May 1, 2020
@ernes32
Copy link

ernes32 commented May 20, 2020

Hi @tiagoalves how would you check the API if other file types Pdf, Text are supported ?
Office.FileType.Pdf , Office.FileType.Txt

https://docs.microsoft.com/en-us/javascript/api/office/office.document?view=word-js-preview#getfileasync-filetype--options--callback-

I tried various options as as argument for "Office.context.requirements.isSetSupported"
File, PdfFile, pdf, TextFile, text, etc.. nothing seems to work.

Thanks.

@tiagoalves
Copy link
Author

@ernes32 I just tested the following in ScriptLab and it worked:

Office.context.requirements.isSetSupported("PdfFile")
Office.context.requirements.isSetSupported("TextFile")

@ernes32
Copy link

ernes32 commented May 21, 2020

Hm.. @tiagoalves it actually does but it seems I have found some inconsistencies in Power Point.
btw. I was testing Excel hoping that PDF file export is finally possible with getFileAsync ;)

I am using online Office with Chromium Version 81.0.4042.0 (Official Build) (64-bit)
with this script

PowerPoint:
CompressedFile status: true
PdfFile status: false
TextFile status: false
getFileAsync status: succeeded type: pdf
File size:96919 #Slices: 2

Word:
CompressedFile status: true
PdfFile status: true
TextFile status: true
getFileAsync status: succeeded type: pdf
File size:84147 #Slices: 2

Excel:
CompressedFile status: true
PdfFile status: false
TextFile status: false
getFileAsync status: failed type: pdf
Error: A network problem has prevented retrieval of the file.

@tpasi
Copy link

tpasi commented May 26, 2020

MSFT fixed the issue and now PDF works as well.
However, Office.context.requirements.isSetSupported("PdfFile") is still returning a false value.

@MandytMSFT
Copy link

MandytMSFT commented May 26, 2020

@tpasi do you mean to Office.context.requirements.isSetSupported("PdfFile") on Excel online ? If yes, the fix is also checked in. Suppose it will be available for coming days.

@tpasi
Copy link

tpasi commented May 26, 2020

@MandytMSFT, yes I meant for Excel for Web, thank you

@MandytMSFT MandytMSFT added Resolution: not actionable Issue is not actionable and removed Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs Resolution: not actionable Issue is not actionable labels Jun 1, 2020
@MandytMSFT
Copy link

This thread contains too many topics, And i think all the question here has been addressed or given suggestion. I'd like to close this thread. @tiagoalves and other people pls open a new thread if issue still here for GetFileAsync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Excel Issue related to Excel add-ins
Projects
None yet
Development

No branches or pull requests

10 participants