I was trying to run a macro stored in a Base file like this:
soffice "C:\Users\nuno\AppData\Roaming\LineMap.odb" "macro://LineMap/Reports.Report.genRep"
However it doesn't work.
A friend have debugged, and in SfxMacroLoader::loadMacro, the call to SfxObjectShell::GetFirst() returns nullptr - it means that the open database isn't listed among open shells - and thus doesn't offer the expected functionality (unlike Writer or Calc components)
Steps to Reproduce:
1. soffice "C:\Users\nuno\AppData\Roaming\LineMap.odb" "macro://LineMap/Reports.Report.genRep"
Open file but doesn't fire up the macro
Fire up the macro
User Profile Reset: No
Repro with Version: 22.214.171.124 (x64)
Build ID: e979878b49a48dab15ebe528f238b88125e32c65
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win;
Locale: ru-RU (ru_RU); UI-Language: en-US
Created attachment 153732 [details]
A DB with a macro
This contains a library Reports, module Report, macro genRep that only shows a "Test" messagebox.
Allowing to run macros, and trying
> soffice dbMacro.odb macro://dbMacro/Reports.Report.genRep
does not show the dialog when opening the DB. As mentioned, the DB doesn't have an associated shell in the list returned by SfxObjectShell::GetFirst called from SfxMacroLoader::loadMacro, thus not allowing to access its macros when dispatching the 'macro:' URI.
Tested this against
OOO320m18 (build 9502)
macro isn't executed there either from the command line. However, it runs just fine when executed manually from via the Macros menu.