Error using xlsread (line 249) Excel Worksheet could not be activated.
이전 댓글 표시
Error using xlsread (line 249) Excel Worksheet could not be activated.
whenever I try xlsread, it just gives me this error I've tried reinstalling, but still did not work.
댓글 수: 5
Ambati Lakshmipathi
2019년 5월 21일
이동: Walter Roberson
2024년 8월 13일
I am also getting error as below
Error using xlsread (line 257)
Excel Worksheet could not be activated.
i am using 2019a version
Robert Bunting
2020년 5월 18일
Following up on the finding that doing "clear all" works, I find that doing "clear functions" prior to calling xlsread works.
However, there are still Excel processes that accumulate, which I kill in Task Manager.
I am running W10, MatLab 2018b, and Office 365. I have been working with Excel files for years, and this problem ("Error using xlsread (line 257) Excel Worksheet could not be activated.") only started happening today.
S Deligeorges
2021년 3월 31일
편집: S Deligeorges
2021년 3월 31일
I have slight variatiuon on the problem. using Matlab R19b, windows 10. I can open an excel file once with xlsread, but every time after that I get the line 249 error. clear all does not fix it, restarting matlab does not fix it, rebooting the machine does not fix it. Matlab touching the file once had made all my data unreadable by Matlab. Any suggestions ?
mehmet utku
2023년 4월 21일
편집: mehmet utku
2023년 4월 21일
clear all worked for me thank you.
yoav smith
2024년 3월 3일
how to delete rows from an array
답변 (11개)
Tobias Elve
2020년 5월 6일
편집: Tobias Elve
2020년 5월 6일
24 개 추천
A 'clear all' does the trick; without restarting MATLAB
댓글 수: 9
Rafael Freire
2021년 4월 13일
Worked flawless for me. Thank you
杨 格
2021년 7월 19일
It worked for me too.
Nancy Mohamed
2021년 8월 4일
It worked for me too, thank you.
TES
2022년 7월 5일
Thanks, it works for me too.
NILADRI
2022년 11월 5일
Exactly!! Thank You so much
Axel
2023년 9월 6일
thanks!!
Abid Morshed
2023년 12월 30일
Thanks
Paul Bevillard
2024년 8월 13일
You da man! I was rackign my brains. Google search never fails......well.....sometimes.
Jair
2024년 12월 7일
GOD, I hope you have a nice day mate! You helped me like no one else has ever done. Thank you so much!!
Ismaeel
2018년 8월 4일
6 개 추천
I had the same problem. After closing-reopening MATLAB, it worked just fine. I have no add-in plugin in Excel.
댓글 수: 1
I get this problem when I have to stop a Matlab script (CTRL-C) which opens a large Excel file. The next time I run the script, it crashes and says 'Excel Worksheet could not be activated'. If i restart Matlab, it is resolved, but that is inconvenient. I'm using R2019a and I believe it was occuring in R2018b and possibly earlier. I have no Excel plugins that I know of.
Walter Roberson
2016년 10월 6일
2 개 추천
Another case with the same problem: https://www.mathworks.com/matlabcentral/answers/275384-xlswrite-error-worksheet-could-not-be-activated
I have been wondering if this has to do with Excel plugins:
"Certain Excel add-ins may also prevent proper termination of Excel. Some known add-ins that might cause issues are Broadcom's "Send to Bluetooth" add-in (btsendto_office.dll) and Bloomberg's TaskpaneHost add-in. Disabling the add-ins that cause issues is a possible workaround."
There have been other reports having to do with Excel plugins that I cannot seem to find at the moment. I suggest going into Excel and seeing if you have any plugins active, and if you do then disabling them and then trying again in MATLAB.
댓글 수: 1
Walter Roberson
2016년 12월 16일
Another plug-in often mentioned as being a problem is Foxit.
Rambod Naimi
2016년 11월 10일
1 개 추천
I am having similar issues with the Excel. I think i have narrowed it down to the fact that it takes longer than 5 seconds on my machine to open the file. there is a actTimeout which is internal to matlab. I don't know how to increase this value to check. but the message is coming from openExcelWorkbook.m file line 33. so i think this is the main issue with some PC's, the time to create a file and verify it was successful is longer than 5 seconds! I have popped the question to mathworks, hope they can answer!
Sean Desten
2017년 2월 27일
1 개 추천
In my case, there were multiple worksheets in the Excel Workbook I was opening. In my code, I was opening first worksheet #1, then worksheet #2. But when opening my workbook, it was open to #2. Switching to #1 in Excel, then saving, fixed the issue.
However, I could not replicate the bug by opening up the Excel book, switching to #2 again and saving (this should have been the initial state that was causing the bug). The code proceeded to open both worksheets without any issue.
Potentially, Excel got stuck in some sort of weird state that 'locked' the worksheets and prevented them from being activated by MATLAB (I'm using locked because I don't know a better word to use - I do not mean actual locking of the worksheet). Switching worksheets and saving may have switched Excel to a more normal state. For reference, I'm using Excel 2016 and MATLAB R2016b.
댓글 수: 2
Anders Simonsen
2017년 4월 21일
Yes, switching to the first worksheet before saving solved the issue for me as well. Thanks a lot :-)
MiguelMauricio
2017년 8월 4일
I got the same problem. I deleted some worksheets and it was solved. Thanks
M Zagorowska
2017년 9월 7일
1 개 추천
I have the same problem - it appears when I save something to Excel using Matlab (this part is OK), then open&close the Excel file outside Matlab, and then try to save something with Matlab to the same file (different rows/worksheet) - this is when I get 'Excel Worksheet could not be activated.' After looking into Windows Task Manager, I can see that the Excel process is not closed - so I end it manually and Matlab works again. Probably not the best way to solve it, but, hey, it works ;) Any official solution would be appreciated, though.
댓글 수: 3
M Zagorowska
2017년 9월 8일
Quick update - this happens only with Windows 10, with Windows 7 it works fine.
Shashank Singh
2018년 2월 5일
편집: Shashank Singh
2018년 2월 5일
This error is occurring in Windows 7 too. I have MATLAB 2016Rb and Office 365.
Cade Cockrell
2019년 4월 9일
I belive it is due to a corrupted file. Try resaving the excel file under a different name as a new file. This worked for me
Anthony
2017년 10월 1일
0 개 추천
I had this error, but it was resolved after applying a MS office update that I had been dragging my feet on for some time.
Md Azimur Rahman
2018년 5월 10일
0 개 추천
I had the same issue. After Removing Foxit add-in it worked.
Flavio Ferrari
2019년 10월 10일
0 개 추천
Restart Matlab (R2019a) worked for me
Kevin Rusch
2020년 8월 13일
Can confirm that restarting worked even when
clear all;
didn't.
Wenhui Qiao
2022년 3월 1일
0 개 추천
Hi, I met with the same problem and finally figured out these excels were generated and may still in use by another software. When I closed this software, my program run without that error. Thanks!
댓글 수: 1
Ramesh Paudyal
2024년 8월 27일
Clear all works fine!
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!