I am getting a WAC token error when i try to access a drive item's workbook why?

Felix Read 30 Reputation points
2024-04-11T15:21:48.8933333+00:00

I am asking this here because i did a search and they give me this site as ms support for graph.

I am working by all items in a drive.
When i find a driveItem whose name contains .xls (a excel file) i must open the file and check for some data in the workbook to try to extract and tag the file.
My Code works for about 80% of the files but for some reason
When y try to open certain workbooks i get a

Error code: AccessDenied

Error message: Could not obtain a WAC access token.

GET https://graph.microsoft.com/v1.0/drives/b!jn6JlS9atkeM-KROA_T53TioJ9238OZLp2jmjTjLFfKXNoWAwIdzTpnXR6T0ZTsa/items/01THFQ36VJGBJMBQET4ZM234CASRKTDA4M/workbook

I tried using a AppClient with full admin rigths, and a user who is site owner and i am getting the same thing for some workbooks.

Can any one give me a hand with this?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Felix Read 30 Reputation points
    2024-04-13T13:21:22.5066667+00:00

    I found out that my error was because of the excel version of the files.

    The Workbook call only works on xlsx files, not on xls

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.