0c2a7aed190bfc2786c61d03560d0a61497539f9
LibreOffice Image Macro
Inserts images into LibreOffice Calc cells based on a mapping table.
Usage
- Open
znova.ods, enable macros when prompted. - On the Vyber sheet, fill column H with image file paths and column I with destination cell references (e.g.
Vysledok.B5) and optional column J is for heigh in pixels while keeping the aspect ration. - Run the macro: Press the button.
Running again clears all previously inserted images and re-draws them.
Adding a Button to Run the Macro
You can add a push button directly to your sheet/page that runs the macro with a single click. This works in Calc, Writer, and Draw.
- Open your document.
- Go to View → Toolbars → Form Controls.
- Turn on Design Mode on the Form Controls toolbar.
- Click the Push Button icon.
- Drag on the sheet/page to place the button.
- Right-click the button → Control Properties.
- In the General tab, set the button text in the Label field.
- Go to the Events tab.
- Next to Execute action, click the … button.
- Select your macro:
- My Macros or your document → library → module → macro name.
- Click OK, then close the properties window.
- Turn Design Mode off.
- Click the button to run the macro.
Description
Languages
Python
100%