Learning to use macros. In Calc, typed in the first example from the Getting Started Guide 7.4, and could run it. Tried to record the second example; but, didn’t hit Enter at the end, so it didn’t give me a chance to save it. (I know now you have to hit Enter at the end of what you type.) So, I typed that one in using the example’s listing; but, Tools > Macros > Run seemed to do nothing. (Still don’t know why, but that’s not what this conversation’s about.)
At least one of those first two macros ended up in a Standard library. One place in the Guide says to avoid that, 'cause you can’t export what’s there. So, I deleted that macro, retyped it, and saved it in a library I made:
My Macros & Dialogs
My Macros
Calc_Library
MacroTesting_Module1
MacroTesting_Module2
At one point, I got the message that Calc couldn’t find dialog.xlb
and script.xlb
; so, I copied those files from .config/libreoffice/4/user/basic/Calc_Library
to .config/libreoffice/4/user/basic/Calc
. That fixed that problem.
Recorded my own macro, (described below), but can’t run it. In fact, now clicking Tools > Macros > Run Macros… immediately crashes Calc. The dialog.xlb
and script.xlb
files aren’t missing this time. And, I can open Tools > Macros > Organize Macros > Basic…, and then open the Organizer… When I do, I see my two example macros listed.
This is important to me because I’m moving a workbook with many range names from Excel to Calc, and the names didn’t transfer. (Again, that’s another problem, not what we’re here for now.) I have the range names in cells immediately above the cells that should be that range, so am copying a name, selecting the range, going to the Name Box, pasting the name, hitting Enter, and then positioning above the next range. Would be really nice to have a macro do that for me.
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.2
Calc: threaded