Point a shape at a macro
xlide_set_shape_macroReassign a shape or button's click macro in Excel and save the workbook. Use an empty macro to clear the link. Ensure the Sub exists before setting.
Instructions
Changes which macro an existing shape or button runs when clicked, and saves the workbook. An empty macro clears the link. Use it after writing a Sub, so a button actually calls it, and after renaming one, because nothing rewrites an OnAction. Give the procedure as Proc or Module.Proc; it must already exist in the project, so write it first. To add a button with its macro, or to remove one, use xlide_manage_shape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro | Yes | The procedure to run, as Proc or Module.Proc. Empty clears the link. | |
| sheet | Yes | Worksheet the shape is on. | |
| file_path | Yes | Absolute path to the Excel file. | |
| shape_name | Yes | Shape name, as xlide_list_shapes reports it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||