Drawing Objects¶
Use drawing for worksheet images, AutoShapes, text boxes, connectors, safe Forms controls, and sparklines.
Object lifecycle¶
| Action | Purpose |
|---|---|
list-objects | List drawing objects on one worksheet |
get-object | Read one object by name |
add-image | Embed a local image |
add-shape | Add a geometric, arrow, or flowchart AutoShape |
add-text-box | Add formatted text |
add-connector | Add straight, elbow, or curved connectors |
add-form-control | Add a worksheet Forms control |
update-object | Rename, move, resize, rotate, format, or change bindings |
delete-object | Delete by object name |
Object names are worksheet-local. Call list-objects before updates or deletion when the exact name is unknown.
Colors use #RRGGBB. Position and size values use points. Placement values are:
1: move and size with cells2: move but do not size with cells3: free floating
Safe Forms controls¶
Supported controls are Button, CheckBox, DropDown, GroupBox, Label, ListBox, OptionButton, ScrollBar, and Spinner.
linkedCell: CheckBox, DropDown, ListBox, OptionButton, ScrollBar, and SpinnerinputRange: DropDown and ListBox only- Button, GroupBox, and Label return explicit nulls for both binding properties
ActiveX/OLE controls and macro assignment are intentionally unavailable. Do not try to create them through VBA as a workaround.
Sparklines¶
Use add-sparkline, get-sparkline, list-sparklines, update-sparkline, and delete-sparkline.
- Types: Line, Column, WinLoss
sourceRange: data to visualizelocationRange: cells that host the sparklines- Line sparklines can show markers