フィルターのクリア

Error using xlsread (line 249) Excel Worksheet could not be activated.

573 ビュー (過去 30 日間)
Jun Ha Park
Jun Ha Park 2016 年 10 月 6 日
コメント済み: yoav smith 2024 年 3 月 3 日
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.
  4 件のコメント
mehmet utku
mehmet utku 2023 年 4 月 21 日
編集済み: mehmet utku 2023 年 4 月 21 日
clear all worked for me thank you.
yoav smith
yoav smith 2024 年 3 月 3 日
how to delete rows from an array

サインインしてコメントする。

回答 (12 件)

Tobias Elve
Tobias Elve 2020 年 5 月 6 日
編集済み: Tobias Elve 2020 年 5 月 6 日
A 'clear all' does the trick; without restarting MATLAB
  7 件のコメント
Axel
Axel 2023 年 9 月 6 日
thanks!!
Abid Morshed
Abid Morshed 2023 年 12 月 30 日
Thanks

サインインしてコメントする。


Ismaeel
Ismaeel 2018 年 8 月 4 日
I had the same problem. After closing-reopening MATLAB, it worked just fine. I have no add-in plugin in Excel.
  1 件のコメント
KAE
KAE 2019 年 5 月 30 日
編集済み: KAE 2019 年 5 月 30 日
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
Walter Roberson 2016 年 10 月 6 日
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
Walter Roberson 2016 年 12 月 16 日
Another plug-in often mentioned as being a problem is Foxit.

サインインしてコメントする。


Rambod Naimi
Rambod Naimi 2016 年 11 月 10 日
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!
  2 件のコメント
K E
K E 2016 年 12 月 16 日
編集済み: K E 2016 年 12 月 16 日
Please post any solution they give you! When I have this issue, sometimes restarting Matlab resolves it, and it will not recur when I run the program again.
sreelatha Aihloor Subramanyam
sreelatha Aihloor Subramanyam 2019 年 11 月 7 日
this helped me.Thanks

サインインしてコメントする。


Sean Desten
Sean Desten 2017 年 2 月 27 日
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
Anders Simonsen 2017 年 4 月 21 日
Yes, switching to the first worksheet before saving solved the issue for me as well. Thanks a lot :-)
MiguelMauricio
MiguelMauricio 2017 年 8 月 4 日
I got the same problem. I deleted some worksheets and it was solved. Thanks

サインインしてコメントする。


M Zagorowska
M Zagorowska 2017 年 9 月 7 日
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 件のコメント
Shashank Singh
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
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

サインインしてコメントする。


Ambati Lakshmipathi
Ambati Lakshmipathi 2019 年 5 月 21 日
I am also getting error as below
Error using xlsread (line 257)
Excel Worksheet could not be activated.
i am using 2019a version

Anthony
Anthony 2017 年 10 月 1 日
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
Md Azimur Rahman 2018 年 5 月 10 日
I had the same issue. After Removing Foxit add-in it worked.

Flavio Ferrari
Flavio Ferrari 2019 年 10 月 10 日
Restart Matlab (R2019a) worked for me

Kevin Rusch
Kevin Rusch 2020 年 8 月 13 日
Can confirm that restarting worked even when
clear all;
didn't.

Wenhui Qiao
Wenhui Qiao 2022 年 3 月 1 日
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!

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by