The workbook contains ActiveX controls that cannot be loaded

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The error "The workbook used to create this project contains ActiveX controls that the designer cannot load" appears when you add a control to a Word document or an Excel worksheet programmatically, save the document or workbook, and then create a new document-level solution based on the document or workbook.

Information that describes the managed type of the control is not saved along with the document or workbook. When you create a new solution based on that document or workbook, Visual Studio does not have enough information to load the control in the host item designer.

To correct this error

  1. Open the document or workbook.

  2. Remove the controls that were added at run time. You can do this by selecting them in the document or workbook and pressing the Delete key.

  3. Create a document-level solution based on the document or workbook.

See also