Description: if i record a macro I get a mass of lines for a simple action In excel I get one line vba per action You already have a table to transform VBA to uno in order to run these macros You should use same object and action names as VBA , if you combine them with starbasic or python that doesn't matter but you can handle it far better Actual Results: rem ---------------------------------------------------------------------- rem define variables Dim document As object Dim dispatcher As object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- Dim args1(1) As new com.sun.star.beans.PropertyValue args1(0).Name = "URL" args1(0).Value = Name_of_Map args1(1).Name = "FilterName" args1(1).Value = "Calc MS Excel 2007 XML" dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1()) Expected Results: Workbooks(Name_of_Map).SaveAs filtername:="Calc MS Excel 2007 XML" Reproducible: Always User Profile Reset: Yes OpenGL enabled: Yes Additional Info: [Information automatically included from LibreOffice] Locale: de Module: SpreadsheetDocument [Information guessed from browser] OS: Linux (All) OS is 64bit: yes
Record Macro works with dispatch (records what you are doing with keystrokes and mouse-clicks) and doesn't really create proper code, no way to "fix" that. It should be rewritten completely. So let's confirm like that (and not really expect it any time soon).
LO 7.2.6.2 continues the difficulty (on my Win 11 install). Recognizing that this would be a massive undertaking, to move MACRO RECORDING from command execution (dispatches) to functional, executable commands in basic ((akin to what happens in MSOffice and VBA)), I would vote for a communal focus in this area. Sadly, my programming skills aren't up. My hope is that (by trivial example, only!), I could turn on a macro recording, change the border color on a shape, and turn off recording. Look in at the recorded macro, and see the exact code that executed that, and then use/manipulate it as needed.