Clear Filters
Clear Filters

Can't open Excel files now that my company has upgraded to Office 365

45 views (last 30 days)
I have two problems reading .xlsx files with MATLAB. Both of these problems started after my company upgraded of MS Office 365 and started mirroring our files with OneDrive (Microsoft® Excel® for Microsoft 365 MSO (16.0.14326.20504) 32-bit ).
The first problem is that I can't open .xlsx files that are already open in Excel. My program used to be able to do this, but now I get a pop-up error message saying that the file is open in another application. This is true whether "Autosave" is on for that file or not. So it seems like Excel is somehow blocking MATLAB from opening the file in a way it wasn't before.
The second problem is that I can't open .xlsx files in MATLAB when I am not connected to a network, even if the file is NOT open in Excel. The files are on my local hard disk, and I can open them with Excel. But when I run my MATLAB program I get the following popup error message: "The network is not present or not started. Check that you are connected to the network and then try again." I don't understand why I need to be connected to the network to open a .xlsx file in MATLAB when I don't need to be connected to open it in Excel.
Any help on either issue would be appreciated. Thank you!

Accepted Answer

Ashutosh Singh Baghel
Ashutosh Singh Baghel on 18 Nov 2021
Hi Brian,
I understand you wish to open ".xlsx" file saved on OneDrive from MATLAB. But an error occurs. The issue is likely to be with OneDrive locking the file for editing purposes, although our development team is aware of the issue and investigating.
For now, the workaround is to close the application which uses the file in OneDrive, and then use MATLAB to load the file. Alternatively, the file can be moved or copied to a local directory, ensuring OneDrive does not lock it.
Refer to MATLAB Documentation page on 'readtable' and 'Compatibility Considerations'.
  2 Comments
Brian Cluggish
Brian Cluggish on 18 Nov 2021
Thanks! I tried moving the .xlsx file to a location on my hard drive that is not backed up to OneDrive. I can now read it with MATLAB while it is open in Excel.
Jon
Jon on 21 Dec 2023
I am still struggling with this problem using R2023b Update 4. Specifically I have .xlsx files on my Onedrive folder, and if they are open when I try to use readtable to read them, MATLAB throws and error, for example:
Error using readtable
Unable to open file 'C:\Users\myAccount\OneDrive\Projects\myFiles\myfile.xlsx' as a
workbook. Check that the file exists, read access is available, and the file is a valid
spreadsheet file.
If the files are closed they can be read without error.
This can be quite annoying/cumbersome as my workflow often involves making modifications to the .xlsx files (which in a sense act as an input gui) and then using MATLAB to analyze the data. So its open, modify, close, run MATLAB over and over, even if I need to modify only one cell in the .xlsx file.
Would be nice if for example readtable, readmatrix, etc included a read only parameter, which would all even open .xlsx files to be read as long as MATLAB didn't alter them.
I would be interested to know what progress is being made on this front by the developers

Sign in to comment.

More Answers (2)

Frank Buntschuh
Frank Buntschuh on 23 Feb 2023
Using R2022b. Still having this issue with Excel files on Sharepoint and using readtable, which I use extensively for local files. On Sharepoint, MATLAB never seems to find the file. I know I can copy the Sharepoint file down to local storage, but this induces a configuration control issue. Any progress on a solution?

Alan Ledesma
Alan Ledesma on 3 Oct 2023
I am experiencing the same problem since my company migrated to SharePoint with Microsoft 360. In our case, considering the new hybrid working format, we need to work in a cloud that is always synchronized on different computers. These communication problems between Matlab and Excel are increasing and at times significantly limit our work. Is there already a solution to this problem?

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!