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
1
vote
1 answer

What is the easiest way to duplicate an OO / LO macro dialog?

In OpenOffice / LibreOffice Calc, what is the easiest way to duplicate a macro dialog? I've got one built already for a particular task, but I need another that is only slightly different, and don't want to have to build it from scratch. I tried…
MikeB
  • 580
  • 3
  • 18
1
vote
1 answer

How to assign a 2d libreoffice calc named range to a python variable. Can do it in Libreoffice Basic

I can't seem to find a simple answer to the question. I have this successfully working in Libreoffice Basic: NamedRange = ThisComponent.NamedRanges.getByName("transactions_detail") RefCells = NamedRange.getReferredCells() Set MainRange =…
1
vote
1 answer

How to type big table in LibreOffice Writer?

Here is what I use. OS: Linux Mint 18 Editor: LibreOffice Writer 5.1.6.2 Situation Consider the following foo.csv file (just example, the raw data contains hundred of lines): A,B,C 1,2,3 To create a table in Writer with the data from foo.csv…
Sigur
  • 355
  • 8
  • 19
1
vote
1 answer

Instr function not case sensitive in LibreOffice basic?

I am writing a function in LibreOffice basic to find position of a character in a string: REM ***** BASIC ***** Const Source = "abcdefghijklmnopwrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" Function GetPos(Char As String) As Integer GetPos =…
Arundale Ramanathan
  • 1,781
  • 1
  • 18
  • 25
1
vote
1 answer

LibreOffice/OOo UNO - where to get API reference?

I am trying to write a Writer macro using LibreOffice Basic. First I tried recording a macro that applies a style to a page. It generated code like this: document = ThisComponent.CurrentController.Frame dispatcher =…
JustAC0der
  • 2,871
  • 3
  • 32
  • 35
1
vote
1 answer

LibreOffice Writer: get contents of the next cell to the found one

I need to find some text in the Writer table, then get contents of the cell right of the found text into the variable. Text is found successfully with this code: Sub get_contr_num dim oDoc as Object dim oFound as Object dim oDescriptor …
Michael
  • 5,095
  • 2
  • 13
  • 35
1
vote
1 answer

Error in calling a Python script from a Basic function

I am new in Python and Basic. I am trying to replicate the IMPORTHTML function from Google Sheets in LibreOffice (LO) Calc. In a nutshell, I want to create a GetHtmTable( Url, Table Index) Basic function in Calc which will call a Python script to do…
Chris
  • 11
  • 3
1
vote
1 answer

How to get the field values from the forms in base libreOffice?

part of the code dim oMainForm as object dim oColumnList as object dim theValue as variant oMainForm = ThisDatabaseDocument.FormDocuments.getByName("update_rform") oColumnList = oMainForm.getByName("rid") #rid is the name of the field from…
Edwin Varghese
  • 473
  • 1
  • 5
  • 15
1
vote
0 answers

Best way to run Macro on LibreOffice or OpenOffice SubForm "Fill parameters" Event

I try for more than a week to fill out a SQL query parameter by running a macro on the "Fill Parameters" event in the subform by searching for a method to fill the parameter under the Parameters object with MRI without success. Searches for guides…
1
vote
1 answer

Libreoffice Writer Macro Change Font Size

This question was posted to help solve this Ask Ubuntu 350 point bounty that ends today. I would rather someone in Stack Overflow post an answer and get the bounty than see it go unrewarded and the OP not getting a working solution. I have this…
WinEunuuchs2Unix
  • 1,801
  • 1
  • 17
  • 34
1
vote
0 answers

Libre Office Writer macro to conditionally change font color

I am on Libre Office 6.0. I generated a macro to change the font color of selected text to 'Blue 3'. It works fine. What I want the macro to do is select the entire document and change the font color to 'Blue 3' for any blue text that is some other…
xnguyeng
  • 113
  • 7
1
vote
1 answer

How to get cell color in LibreOffice Basic?

I want to count the occurrences of yellow, orange, green, and red within the selection using a LibreOffice Basic macro. I have been to this Stackoverflow question, but it doesn't work for me. Here's the code: Sub Main dim selection,cell as…
lukmi
  • 31
  • 4
1
vote
1 answer

Call built-in IRR function in macro

I am trying to call the IRR function from a LibreOffice basic macro, but get an Illegal Argument Exception Function Bla() Dim oFunc as Object oFunc = createunoservice("com.sun.star.sheet.FunctionAccess") Dim args(1) as Variant args(0) =…
Simon
  • 177
  • 5
1
vote
1 answer

LibreOffice Basic Macro command converting Calc cellRange to RTF/HTML

My goal is to fill a LibreOffice calc sheet, and silently send a cell range by email when the user clicks the send-off button (and once more to confirm). So there is three part to this. A push button with a request to confirm. (Easy and…
1
vote
0 answers

How to extract data from webpage in libreCalc-macro

Sub navigateurl() Dim number As Integer Dim URL As String Dim propertyname As Object URL = "http://keystonemanagement.com/apartments/me" Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate URL Do While…