Visual Basic Reference

CreateEmbed Method

See Also Example Applies To

Creates an embedded object. Doesn't support named arguments.


object.CreateEmbedsourcedoc, class

The CreateEmbed method syntax has these parts:

Part Description
Object An object expression that evaluates to an object in the Applies To list.
Sourcedoc Required. The filename of a document used as a template for the embedded object. Must be a zero-length string ("") if you don't specify a source document.
Class Optional. The name of the class of the embedded object. Ignored if you specify a filename for sourcedoc.


To view a list of valid class names available on your system, select a control, such as the OLE container control, select the Class property in the Properties window, and then click the builder button.

*Note* You don't need to set the Class and SourceDoc properties when using the CreateEmbed method to create an embedded object.

When you create a new object, the application associated with the class name (for example, Excel.exe) must be correctly registered with the operating system. (The application setup program should register the application correctly.)