Why can I not import an excel file into MATLAB without error?

4 views (last 30 days)
Hi,
I have an excel file with only two columns filled and 21 rows. Simply, one column is filled with x-values and the second column are y-values. Whenever I try to import that file (saved as .xlsx and I even tried saving it as .xls) into MATLAB, all I get is the error message "Could not open the spreadsheet. MATLAB reported the following error: Error: The server threw an exception."
I just want to import these values into MATLAB...it's such a small file. I could type the values in but the fact is I shouldn't have to.
  2 Comments
Rodney Sinkler
Rodney Sinkler on 19 Mar 2017
I'm experiencing the same difficulty and the suggested post only addresses writing to xls. Just to be sure, I checked to see if I had any bluetooth add ins in excel and I don't. I even tried running MATLAB as an admin and the import wizard still reports "the server threw an exception" Please help!

Sign in to comment.

Answers (1)

Samuel Katongole
Samuel Katongole on 5 Jul 2021
Try testing your files with the following trial codes:
fid=fopen('oil_prices_testdata.csv')
fid=fopen('oil_prices_testdata.xlsx')
I had a similar challenge; and checked the file identifier (fid). A positive one indicates your file will open, and if it is -1, then it will not open. If your obtain the latter, try putting your excel file in your current (or working) directory. And agin use the import tool.

Categories

Find more on Data Import from MATLAB 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!