No appropriate method, property, or field AddChart for class Interface error?

I recently updated from Excel 2007 to Excel 2013 and I am now having issues running my code. I ran the code on an older computer with older MS software and no issues. The error is shown below:
try
Select(Range(EXCEL,sprintf('%s',range))); %select cells
EXCEL.ActiveSheet.Shapes.AddChart.Select;
The error is: No appropriate method, property, or field AddChart for class Interface.0002443A_0000_0000_C000_000000000046.
set(EXCEL.ActiveChart,'ChartType',90);
catch ME
beep;
fprintf('There may be too many Item types for the charting to work properly!\r\r');
disp(getReport(ME));
break;
end
Maybe someone has had this problem and can help. Thanks

回答 (2 件)

Thiago Motta
Thiago Motta 2016 年 10 月 14 日
Hello
I have Excel 2013 and the following works for me:
Chart = Excel.ActiveSheet.Shapes.AddChart2;
According to this Shapes.AddChart doesnt exists, but Shapes.AddChart2 exists.

1 件のコメント

iitm_pnkj
iitm_pnkj 2021 年 8 月 17 日
I need solution for this
https://in.mathworks.com/matlabcentral/answers/1413147-how-to-find-and-replace-text-provided-in-a-textbox-in-a-docx-file

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

Tarik Khoury
Tarik Khoury 2015 年 12 月 7 日

0 投票

Hello Laszlo,
I have the same issue. Did you find a solution for your issue?
Thanks

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2014 年 8 月 12 日

コメント済み:

2021 年 8 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by