MATLAB: Paste into excel from matlab figure

activexclipboardexcelmatlab figurepaste-special

I am encountering a problem when I try to paste-special from the clipboard (after copying using {print (fig,'-dmeta')}) into Excel. "invalid simulink identifier" is the error I recieve when I use {activeX} syntax in my GUI. Does any one know what might causing that error or how to fix it? P.S. – it works on a different computer that has Matlab R2015a and windows 10, while it fails on a computer with R2013a…

Best Answer

You forgot to show your ActiveX code where you try to paste the clipboard into Excel.
To copy the current figure into the clipboard, use
print('-clipboard', '-dmeta');
which is not what you did.