AddOLEObject Method Example

This example adds a linked Word document to myDocument.

Set myDocument = Worksheets(1)
myDocument.Shapes.AddOLEObject Left:=100, Top:=100, _
    Width:=200, Height:=300, _
    FileName:="c:\my documents\testing.doc", link:=True

This example adds a new command button to myDocument.

Set myDocument = Worksheets(1)
myDocument.Shapes.AddOLEObject Left:=100, Top:=100, _
    Width:=100, Height:=200, _
    ClassType:="Forms.CommandButton.1"