python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

Value Error: This file is not a valid Excel xlsx file.

Open shuo0220 opened this issue 5 years ago • 3 comments

I kept getting this value error when I attempted to open an excel file on our company's onedrive. What i should put in this "my_file_instance"? I've tried the path and the link copied from onedrive, but both of them generated this value error.

I have the following in my scopes, and the authentication worked. I was able to send email by using O365. scopes=['basic', 'message_all', 'onedrive_all', 'sharepoint_dl']

Thank you very much!

image

shuo0220 avatar Dec 27 '20 17:12 shuo0220

You need to use the Drive functionality to get a File instance and then pass this object to the Workbook constructor. It is metion explicit on the readme:

To work with excel files, first you have to retrieve a File instance using the OneDrive or Sharepoint functionallity.

alejcas avatar Jan 14 '21 11:01 alejcas

You need to use the Drive functionality to get a File instance and then pass this object to the Workbook constructor. It is metion explicit on the readme:

To work with excel files, first you have to retrieve a File instance using the OneDrive or Sharepoint functionallity.

But how do you do that?

Bis-Crenson avatar Aug 22 '21 16:08 Bis-Crenson

But how do you do that?

https://github.com/O365/python-o365#onedrive

alejcas avatar Sep 03 '21 10:09 alejcas