MATLAB: Do I receive a “serialization” error when I open the GUI in MATLAB

activeactive xfailedmappointMATLABserializationx

I have used GUIDE to create a GUI that includes a particular ActiveX control. When I try to execute this GUI, a modal dialog box appears, saying:
Serialization of COM object failed. 'Foo Control 11.0' could not be restored to its previous state.
Make sure the file MyGui_activex1 is in the same directory as your GUI.

Best Answer

Upon executing a GUIDE-created GUI, the ActiveX control is first created, then the properties of ActiveX control are set according to the file mentioned in the dialog box (this is "serialization").
However, some ActiveX controls require a special initialization sequence, such as calling a particular method on the ActiveX control's handle before its properties are set. The creation sequence described above will fail for such objects.
If you are using such an ActiveX control, you will need to manually create the ActiveX control in the GUI's opening function (the "OpeningFcn" callback), instead of using GUIDE's default behavior. The attached files on this page show an example with the "OWC11.Spreadsheet.11" control.
This issue has been resolved in MATLAB R2017b.