Bug 149722 - `Macro Selector` should only show macros to Run which are “not Private” and have “no arguments passed”
Summary: `Macro Selector` should only show macros to Run which are “not Private” and h...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-24 22:10 UTC by Óvári
Modified: 2022-07-18 03:27 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Macros.xls (40.00 KB, application/vnd.ms-excel)
2022-06-24 22:11 UTC, Óvári
Details
MS Excel Macro Window screenshot (24.90 KB, image/png)
2022-06-24 22:13 UTC, Óvári
Details
LO Calc Macro Selector Window screenshot (31.19 KB, image/png)
2022-06-24 22:17 UTC, Óvári
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Óvári 2022-06-24 22:10:01 UTC
Description:
End users may `Run` macros which were programmed by others. To improve the user experience, only valid macros should be listed in the `Macro Selector` window.

Actual Results:
Macros which produce errors when run or are private can be access by the `Macro Selector`.

Expected Results:
Macros which produce errors (i.e. ones with passed arguments) when run or are private should not be shown in the `Macro Selector`.


Reproducible: Always


User Profile Reset: No



Additional Info:
`Macro Selector` should only show macros to Run which are “not Private” and have “no arguments passed”


End users may `Run` macros which were programmed by others. To improve the user experience, only valid macros should be listed in the `Macro Selector` window.

LibreOffice Calc should only showing macros that can be Run in the LO Calc `Macro Selector`.  Screenshot will be attached later.

Macros which are `Private` or are passed arguments should not be show. Inspiration from MS Excel. Screenshot will be attached later.

Code examples:

```
Private Sub PrivateFunction()
    MsgBox "This subroutine should not show in the list of macros to run as it is private"
End Sub

Sub FunctionWithArguments(intVariable As Integer)
    MsgBox "This function should not show in the list of macros to run as it is passed argument(s)"
End Sub

Sub FunctionNotPrivateNoArguments()
    MsgBox "This function should show as it is public and does not get passed any arguments"
End Sub
```

What do you think?

Thank you
Comment 1 Óvári 2022-06-24 22:11:49 UTC
Created attachment 180953 [details]
Macros.xls

MS Excel spreadsheet with 3 functions:
1. Private
2. With passed argument(s)
3. Public and no passed arguments
Comment 2 Óvári 2022-06-24 22:13:55 UTC
Created attachment 180954 [details]
MS Excel Macro Window screenshot

MS Excel only displays 1 macro which can be run, i.e. the public macro with no passed arguments.

Clicking `Run` produces no error.
Comment 3 Óvári 2022-06-24 22:17:52 UTC
Created attachment 180955 [details]
LO Calc Macro Selector Window screenshot

LO Calc displays 3 macro which can be run.

The `Private` macro can be run, which is wrong

The `Passed Argument` macro can be run, which produces an error.

Perhaps this issue should be changed from request for enhancement (RFE) to bug?

What do you think?

Thank you