Name
oleobject.Add([ClassType], [Filename], [Link], [DisplayAsIcon], [IconFileName], [IconIndex], [IconLabel], [Left], [Top], [Width], [Height])
Synopsis
Creates a new OLE object on a sheet.
|
Argument |
Settings | |
|---|---|---|
|
|
The programmatic ID of the object to create. For example | |
|
|
The filename of the object to create. You must specify | |
|
|
True links the object to | |
|
|
True displays the object as an icon or a picture; False renders the object in the worksheet. | |
|
|
If | |
|
|
If | |
|
|
If | |
|
|
The distance between cell A1 and the left edge of the object in point. | |
|
|
The distance between cell A1 and the top edge of the object in point. | |
|
|
The width of the object in points. | |
|
|
The height of the object in points. |
Tip
The Width and Height arguments aren’t absolute. Their actual result depends on the OLE object being created.
The following code creates a new embedded Word document on the active worksheet:
Sub AddObject( ) Dim ws As Worksheet, ole Set ws = ActiveSheet ' Create the object. Set ole = ws.OleObjects.Add("Word.Document", ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access