why does appear this error: "Unable to open file 'C:\Users\​jonat\Desk​top\Clean\​~$2019-04-​26 Clean.xlsx'?

3 views (last 30 days)
Hello everyone
I have a command that allows to read excel files, and when I apply run, appears an error that I don't get why appears:
Error using readtable (line 216)
Unable to open file 'C:\Users\jonat\Desktop\Clean\~$2019-04-26 Clean.xlsx' as a workbook. Check that the
file exists, read access is available, and the file is a valid spreadsheet file.
Error in Voc_Ambos (line 12)
thistable = readtable(thisfile);
Even when I take out the file 2019-04-26 Clean.xlsx from the folder "Clean", still appears this error.
What can I do?
Please help
Thank u

Answers (1)

Fangjun Jiang
Fangjun Jiang on 27 Jun 2019
The name "~$2019-04-26 Clean.xlsx" indicates it is a temporary file. Is the file opened or edited by another program or by the code prioir to this line? Just make sure there is no conflicting access to this file and run readtable() alone to try it out.
  4 Comments
Jonathan Bijman
Jonathan Bijman on 27 Jun 2019
I uninstalled MATLAB and I installed again, I did the same thing with microsoft office and it still appears the error.
please help!
Fangjun Jiang
Fangjun Jiang on 28 Jun 2019
It might have nothing to do with MATLAB. dinfo indicates that "~$2019-04-26 Clean.xlsx" is in the list.
  1. Might it be that "~$2019-04-26 Clean.xlsx" is hidden in your folder?
  2. Might it be that "2019-04-26 Clean.xlsx" file contain some macros that opening or reading it caused the temporary file? Remove "2019-04-26 Clean.xlsx" from the folder and try it again.

Sign in to comment.

Categories

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

Community Treasure Hunt

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

Start Hunting!