Questions tagged [libreoffice-basic]

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.

240 questions
3
votes
1 answer

Using regex in a libreoffice calc macro to extract text from parentheses in a cell

Using Libreoffice 3.5.7.2 on Ubuntu 12.04. I have text in calc cells in the form of: (IBM) Ibm Corporation. I am trying to use regex to extract the text between the ()'s using a basic macro. This is what I have tried so far. Sub getMktValue() Dim…
Agent_15x
  • 373
  • 4
  • 13
3
votes
1 answer

Libre office calc trigger BASIC function using button

I wrote a little BASIC function in libreoffice to get some sorting stuff done. Works nicely.. Now I want to trigger this function by pushing a button on the first sheet. I really don't get it working. I set a link to the basic function (Right-click…
Michael
  • 706
  • 9
  • 29
3
votes
4 answers

Path of current document in [Libre|Open]Office

How can I determine the path of the currently open document in an OpenOffice or LibreOffice document? I want to forward the path to an external application. More specifically I want to launch an external player from impress with a video file in…
dubbaluga
  • 2,223
  • 5
  • 29
  • 38
2
votes
0 answers

Will async operations finish before workbook is closed?

I have searched and read the API description, but I can't find an answer whether async operations are forced to be completed before LibreOffice Calc is closed. For example: dispatcher.executeDispatch() or ThisComponent.storeToURL() are both…
Mike KMB
  • 21
  • 3
2
votes
1 answer

How to run a script from another document

I have two doc LibreOffice calc test1.ods and test2.ods. I want run a script in test2 from the script of test1. When test2 is open by the script of test1, i can't run the script on test2 even from test2. How i can pass out the security for the…
patol
  • 136
  • 2
  • 10
2
votes
1 answer

Resize and modify selected chart with libreoffice basic

I'm writing a macro with libreoffice basic to modify the styles and size of a selected (and only selected) chart in my spreadsheets. After many documentation reading and many tries, I managed to have a partial solution to my problem: Modifying all…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
2
votes
1 answer

LibreOffice calc Hyperlink from macro doesn't work

I have trouble making hyperlink within macro. For example just create empty spreadsheet and create another sheet within so we have 2 empty sheets. In Sheet1 A:1 just paste =HYPERLINK("#Sheet2") For A:3 create macro and execute it Sub TestMacro …
eSlavko
  • 348
  • 3
  • 12
2
votes
1 answer

"base" Keyword in LibreOffice Basic

I'm writing a macro for LibreOffice Calc in Basic in VBA compatibility mode. It complains when I use this line: Const BASE = 3 BASIC syntax error. Symbol expected. and the syntax coloring seems to indicate that "BASE" is a keyword or reserved…
Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439
2
votes
1 answer

What is the function Debug.Print (VBA) for Oobasic or StarBasic in LibreOffice?

I'm writting a macro in LibreOffice and woudld like to print somethings in the IDE window of LibreOffice. In VBA I use Debug.Print to print some values in the IMMEDIATE Window. What is the function Debug.Print (VBA) for Oobasic or StarBasic in…
jMcfly
  • 35
  • 1
  • 6
2
votes
0 answers

LibreOffice Command Line Open Docx File, On Linux

I need to open Docx file using LibreOffice in command line mode. libreoffice6.0 -o [filename].docx Then.. This command is running in script, I can't handle the confirm window. So is it possible to open document directly ?
2
votes
1 answer

Using built in Calc function when recording a macro

I am working through Excel for Engineers and trying to adapt it for LibreOffice Calc. I have run into a problem. I know this is easier to do without using macros but humor me. One of the exercises is to start recording a macro, type: =RAND() hit…
Jay
  • 75
  • 1
  • 9
2
votes
1 answer

LIBRECALC Separate cell contents into new row (comma separated), but duplicate other contents

I mostly use R for my data analyses, but I was hoping for an easier upfront fix for my dataset within LibreCalc. Essentially, I have a dataset I am collecting for research in the field and, for expediency's sake, I am using commas to separate…
2
votes
1 answer

How do we import the listener events of LibreOffice Writer in Visual Basic 6

How do we import the listener events of LibreOffice writer in Visual Basic 6? I am trying to create a UNO service to get container listener event like following code, Dim oListener As Object oListener = CreateUnoListener("ContListener_", …
Raja Sahe S
  • 587
  • 1
  • 7
  • 13
2
votes
1 answer

how to do http request using libreoffice basic macros

I want to write a macro on a LibreOffice spreadsheet, to send an HTTP request to an web URL and receive a JSON like response. Can i do it with LibreOffice basic macro programming? Where can i get information about the API. I really appreciate any…
2
votes
1 answer

Calculating logarithm own base in Basic (LibreOffice Calc Macro)

LibreOffice has function LOG(x;n) where you can define your own base. However, when I use Macro to write function in Basic, It does not take second parameter into account thus calculating natural logarithm. How to calculate logarithm with own base…
Grzegorz
  • 3,538
  • 4
  • 29
  • 47
1
2
3
15 16