Error using writetable function in Matlab R2017a

11 views (last 30 days)
Hello,
I've just started working with a trial version of Matlab R2017a. I've been using the same code I worked with in the latest version, Matlab R2015a, but it is not working in R2017a. I need to save an excel file in the end of the code, but it appears to happen several different errors every time I run it. As part of the code I added a function that is only available in Matlab R2017 and therefore I cannot work with the older version anymore. Can somebody, please, help me? Have you seen something similar?
One of the errors, for instance:
"The range must be a character vector of the form 'A1:B2' or 'A1'."
But if you check my code:
filename = 'planilha.xlsx';
writetable(T,filename,'Sheet',1,'Range','A1')
I defined a range.
Another random error if I run the program again:
Disable sheet protection, disable workbook's Mark as Final option, and ensure input does not exceed cell capacity.
As you can see it is not only one error, but it is completely random.
I'll be glad if someone can help me.
  3 Comments
Louise Giansante
Louise Giansante on 13 Jun 2017
Thank you for your comment; however, this error seems to be completely random. If I run my routine again, another error occurs. Also, when I used 2015a version, it didn't happen.
Walter Roberson
Walter Roberson on 13 Jun 2017
Is there a different process also running that is accessing the file?

Sign in to comment.

Answers (1)

alexandre iolov
alexandre iolov on 27 Oct 2017
I just received this error out-of-the-blue, when writing a 9x9 table to a perfectly non-existing .xlsx (or .xls) file. It turns out that the cause is that i have very large dates (sentinels for infinity) e.g. this will blow up
dt = utcdatetime(9999, 12, 31, 23,59,60)
T = array2table(dt)
writetable(T, 'BigDate.xls')
This will not
dt = utcdatetime(9999, 12, 31, 23,59,59)
T = array2table(dt)
writetable(T, 'BigDate.xls')

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!