LibreOffice Basic is a procedural, interpreted programming language from the Basic family that can be used to write macros for applications in the LibreOffice Suite.
Questions tagged [libreoffice-basic]
240 questions
1
vote
1 answer
LibreOffice CALC macro Hex2Bin and Bin2Hex functions
can anybody help me with solving my problem of Hex2Bin and Bin2Hex functions?
First I was trying to make the conversion Hex2Bin. I would like to call the AddIn function from macro so I called createUNOservice:
Function fcHex2Bin(arg as variant,…

LibichJ
- 11
- 1
1
vote
1 answer
Libreoffice Unable to fill ListBox because I could not declare the listbox righteously
I have a Listbox in my Calc Worksheet and I am trying to address it for filling it with data
DialogLibraries.LoadLibrary("Standard")
oDialog = CreateUnoDialog(DialogLibraries.Standard)
listBoxGruppe =…

Tobi S
- 145
- 8
1
vote
1 answer
Libreoffice How to convert Cell.CellAddress.Row (is a number already) to an interger?
I would like to create a String for a CellRange and for that I have a RowNumber, but struggle to append it to a String
The 1st two lines of code are only for clarification, that you know which datatype Cell has
CellRange =…

Tobi S
- 145
- 8
1
vote
1 answer
How to copy data into cells, make a table and add more data to it
UI looks like:
Account:Wessex bank plc
Income: 200€
Costs:
Date: 28.02.2021
Output should be a list below in the cells:
Date: | Account: | Income: | Costs: |
28.02.2021 | Wessex Bank plc | 200€ |
28.02.2021 | Food | - | 175€ |
Hint: I would like to…

Tobi S
- 145
- 8
1
vote
1 answer
LibreOffice Base form: filling table or grid control not bound to data source
I have a LibreOffice Base DB with a form and a table control on it. There is a macro that gets some data to put in the table. The table is not bound to a data source and it has 1 column "id". I try the following code to add a row to empty…

iyugov
- 13
- 4
1
vote
1 answer
How to programmatically open and modify ODT file from Calc Macro
I am writing a Macro programm in a LibreOffice Calc spreadsheet. This macro should do the following (amongst other things):
open an existing ODT text document as a template
search and replace some strings with new values
save a copy of this as a…

martin_wun
- 1,599
- 1
- 15
- 33
1
vote
2 answers
getDataArray() and "Object variable not set" error
Installation: LibreOffice 7.0.0.3, Win10 2004 19041.450
I get "Object variable not set" run time error when I run this code. In the LibreOffice debugger I can see the 2-D array with values properly. I am not able to access individual values inside…

Sandeep S D
- 397
- 1
- 4
- 16
1
vote
1 answer
Libreoffice Base - how to call a control event from a macro?
Question: I need to manually call an object listener event (e.g. key pressed) to trigger a function. I used to do it in Access but haven't found the documentation for it in LibreOffice Base.
Context: Having retired from software development 7 years…

Hippy Steve
- 111
- 1
- 2
1
vote
1 answer
how to copy only one row within cells of multiple rows in LIbreoffice calc?
I have large number of cells with multiples rows in each cells. Is there any command or regex or formula to copy only 1st or 2nd rows within cells from a large no of cells?

Abdullah Nasir
- 74
- 1
- 6
1
vote
0 answers
grouping a column of categorical variable into a set of unique values
Following this question, I want to know how I can specify a column/row of a specific sheet including a categorical variable, in Open/LibreOffice BASIC script/macro and get the unique list (i.e., set) of the values.
For example, consider the below…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
1
vote
0 answers
two-way ANCOVA: Analysis of Covariance in LibreOffice Calc
Following this feature request, I want to know if/how I can have a macro to provide a simple GUI to do two-way ANCOVA (Analysis of Covariance) in Open/LibreOffice Calc. There is already an ANOVA tool in Calc, which does not comply with my…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
1
vote
1 answer
How to loop on range of rows in LibreOffice Calc spreadsheet, comparing cell values, setting cell values and deleting row, if condition is true
I have the following requirement in my LibreOffice Calc spreadsheet:
ForEach Row 'r' in selected range,
starting from the last row in the range,
and moving backwards (up) one row at a time,
do some cell value comparisons, and based on that,…

Anto Jose
- 35
- 1
- 7
1
vote
1 answer
LibreOffice how to recup the current element
I want to retrieve the current element in LibreOffice Impress to apply changes to it.
For example, I'm trying to retrieve this shape to change the text in it with macros.
I tried to find information with the X-ray tool but without success.

Adri
- 144
- 8
1
vote
0 answers
Getting Macro Error: Argument is not optional
I have the following function in my Libre Office macro:
Function izracunajHash(geslo As String, zacetni_hash As Integer)
If zacetni_hash = 1 Then
izracunajHash = 5
Else
izracunajHash = 1
End If
End Function
I call it…

primix
- 355
- 1
- 8
1
vote
2 answers
libreOffice command line macro does not return output or error
I want to convert ods documents to xls using libreOffice macro in cli but it seems i do not have any output and libreOffice does not produce any error ( at least not visible ones ).
Here is the command i run :
libreoffice --norestore --invisible…

PopHip
- 700
- 6
- 23