Page 1 of 1

Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 9:41 am
by sanmahaan
Hello,

I wish to assign a macro from My Macros
to a shape, say a rectangle box.
in a Calc Sheet.

But on trying to do so,
I am not able to access the macros in MY MACROS.

I realise that maybe only the macros of the open CALC sheet are only accessible.

Is there a way to assign the macros in MY MACROS to the shape in a CALC sheet.

(I am new to LibreOffice.)

Thanks in advance.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 10:21 am
by Zizi64
I realise that maybe only the macros of the open CALC sheet are only accessible.

Is there a way to assign the macros in MY MACROS to the shape in a CALC sheet.
Do you want to assign a macro from a custom Module of the MyMacros/Standard library?
It is works for me. I can assign a macro from these Modules. (These are my own macros.)
Note: if those macros are available in your PC only, the macros assigned to the shape will not work in an another PC, when you send the document to others. It is better to embed the macro code into the document - if you want to send the document to others.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 10:31 am
by sanmahaan
Thank you Zizi64 for your response.
I am not able to view the macros while trying to assign them to the rectangle shape.

In the pop up, there are two boxes with headings "Macros" and "Existing Macros" and both are empty.
THe Assign button is disabled.

But when I try to assign a macro to a button I am able to navigate to the Macros dialogue.

Not sure why I am unable to view the macros list while trying to assign to a shape in Calc page.

Also to put aside doubts.. all of these are in one system only.. no two PCs are involved.

Help requested

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 12:50 pm
by Villeroy
We have a tutorial section with subsections for components.

[Tutorial] How to install a code snippet

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 1:48 pm
by sanmahaan
Thank you Villeroy..
I have checked your info.. (except the site, which I shall check later)..
am unable to work out my solution yet.
Help requested.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 2:17 pm
by Villeroy
You fetch some item from the "Drawing" toolbar and draw it onto some document, right? Which type of item? Which type of document?
What do you do next? I can not find any option to assign a macro to a rectangle shape on a Writer document. So I assume that its not possible.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 4:24 pm
by Zizi64
I am not able to view the macros while trying to assign them to the rectangle shape.

In the pop up, there are two boxes with headings "Macros" and "Existing Macros" and both are empty.
THe Assign button is disabled.
Right click on the shape - Assign Macro:
Assign_Macro1.png
MyMacros - Standard - here will apeared your Modules:
Assign_Macro2.png
select the desired Module, and the select the desired Macro subroutine (one of the existing user defined macros). - The 'Assign' button will highlighted. Click on it. The selected macro will be assigned to the 'click event' of the shape:
Assign_Macro3.png
Click on the OK. The macro will work, when you click (left click) on the shape.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Thu May 11, 2017 4:59 pm
by Villeroy
Only in Calc and Impress the context menu of a shape allows you to assign a macro. There is no such menu item availlable in Draw and Writer.

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Fri May 12, 2017 7:37 am
by sanmahaan
Screenshot-1.png
Screenshot-1.png (4.9 KiB) Viewed 4119 times
Selecting the rectangle shape from the Toolbar in the calc sheet
Screenshot-2.png
trying to assign macro to the shape in the CALC sheet
Screenshot.png
Unable to view any macros, though I can view all this for other shapes

I am in CALC sheet (not Writer).. Hope this makes my position clear.

Help requested.
Thanks in advance

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Fri May 12, 2017 7:42 am
by sanmahaan
By shapes I meant the button.. I am able to view the list of macros for button but not for rectangle shape
By shapes I meant the button.. I am able to view the list of macros for button but not for rectangle shape

Re: Assign a macro to shape in Calc sheet from My Macros

Posted: Fri May 12, 2017 8:16 am
by Zizi64
Libreoffice 4.0.2.2 on LINUX
Maybe it is a bug in your version... I am using LO 4.4.7, but it works in my Portable LO 5.2.6 and Portable LO.5.3.2 and in my Portable AOO 4.1.3.


Tips:
Check if a JRE is installed and works...

Try to reset (delete or rename) the user profile of your LibreOffice
viewtopic.php?f=74&t=12426

Try to reinstall the LibreOffice.

Upgrade your LO to te latest Still version.