MATLAB: Can I embed another application’s document in a MATLAB figure window

activexandcomdocembeddinghtmlielinkingMATLABobjectoleserver

Can I embed another application's documents (such as Excel worksheet) in a MATLAB figure window? What about web pages? Can I embed arbitrary documents?

Best Answer

Excel does not have an ActiveX control but does allow its documents to be embedded into MATLAB figure windows through the use of ActiveX document serving. These documents can be embedded by using the Shell.Explorer ActiveX control.
Here is how to embed an Excel workbook into a figure window:
figure ('pos', [100 100 780 420])
hBrowser = actxcontrol ('Shell.Explorer', [0 0 780 420]);
invoke (hBrowser, 'Navigate', 'file://d:\tmp\myexcel.xls');
You can also embed web pages into the figure window:
figure ('pos', [100 100 780 420])
hBrowser = actxcontrol ('Shell.Explorer', [0 0 780 420]);
url = ['www.mathworks.com'];
invoke (hBrowser, 'Navigate', url);
Check your application's documentation to see if it is an ActiveX document server. Any of these documents should be embeddable in a MATLAB figure window using the Shell.Explorer control.