0

I would like to know if there is any way for me to access data from an excel file that is in a directory in which I do not have access to the root folder. It is therefore a different directory than mine. Another Company.

The only access I can get is through the browser, entering my email address and waiting for the verification code. Without any password.

I would like to do this with python automatically.

The folder with the file was shared with me.

This is the address of file:

https:// [Another Company] .sharepoint.com/:x:/r/personal/ [name of person] /_layouts/15/Doc.aspx?sourcedoc=%7B17AB449A-DCF4-471F-8129-11798DCDF24B%7D&file=2%20-%20Consulta%20Popular%202023-abr_2023.xlsx&action=default&mobileredirect=true

This is the address of the folder where the file is:

https:// [Another Company] .sharepoint.com/personal/ [name of person] /_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fcarolina%2Dgyenes%5Fspgg%5Frs%5Fgov%5Fbr%2FDocuments%2FConsulta%20Popular%20%2D%20DOF%2DDARP%2DSEFAZ&ga=1

I don't have any code attempt to demonstrate because all posts I've seen use password for authentication.

Any help will be welcome.

Wilian
  • 1,247
  • 4
  • 11
  • Hi, by access, you mean download or view in browser? – Laurent Apr 23 '23 at 07:43
  • Hi, any access to files data would be helpful. Maybe pandas. The important thing is that it is not done manually, entering the site, typing the e-mail address and waiting for the e-mail message with the access code. – Wilian Apr 23 '23 at 18:50
  • Try accessing the URL from VBA using `Workbooks.Open`. If this works, it's possible to drive Excel via COM using the *pywin32* library. Othewise it possible to drive a browser programmatically with *selenium* but then you'd also need to drive your MS Outlook via COM/pywin32 to get the email. Finally there is the [Graph API](https://learn.microsoft.com/en-us/graph/use-the-api) but I'm not sure how you configure the access tokens! – stevecu May 03 '23 at 14:17

0 Answers0