Questions tagged [openoffice-basic]

OpenOffice.org Basic is a programming language which is based on StarOffice Basic and bears similarity to Microsoft VBA.

Resources:

109 questions
2
votes
2 answers

How to get Document-Coordinates from a Mouse Click in an OpenOffice BASIC Macro

Background: I want to paste (like [CTRL+V]) anything (preferably image, shape) at the position I click or hover with the mouse (when using a key to activate). I don't know how to get the position on the document (X, Y) I clicked. (Apache OpenOffice,…
Countryen
  • 31
  • 7
2
votes
1 answer

Open an OpenOffice Spreadsheet from a Writer Macro

I'm new to OpenOffice and I'm trying to port an MS Office macro over to OpenOffice Basic. I need to be able to open a Calc spreadsheet from Writer so I can dump its contents into an array in my Writer macro. The OpenOffice documentation is tough…
Bob_Kruger
  • 125
  • 1
  • 4
  • 17
2
votes
1 answer

How to count duplicate entries in OpenOffice/LibreOffice BASIC?

I have a gnarly amount of data across many sheets in LibreOffice -- an ADDRESS column and a DATA column -- and I'd like to count the number of times each address occurs, put into a NUM_ADDR column. E.g.: ADDR | DATA |…
calcium3000
  • 177
  • 1
  • 10
2
votes
1 answer

STRJOIN macro suddenly broken in LibreOffice / Open Office

This is my first post to Stackoverflow. I have gotten so much help and value from so many people on this site, so I want to first say thank you to everyone on this forum for their incredible knowledge and generous spirit. Much appreciated! I've…
2
votes
1 answer

Open/Libre Office macro to scroll view to selection

In Writer, I would like to search for some text and when found position the view to the top of the view/window. Using the following code, document = ThisComponent.CurrentController.Frame dispatcher =…
2
votes
1 answer

OpenOffice Calc Javascript Function

I want to write a simple function to be used in OpenOffice Calc. It would return true if the cell's value contains a substring, e.g. function contains(string, substring) { return (string.indexOf(substring) > -1); } But I can't find any…
isapir
  • 21,295
  • 13
  • 115
  • 116
2
votes
1 answer

Lack of access to all functions in exposed interfaces?

I have a rather fundamental issue with coding in OpenOffice/LibreOffice Basic that I can't seem to figure out. I don't always have access to all the functions I'm supposed to. Here's an example: Sub TestSub Dim doc As Object doc =…
Jez
  • 27,951
  • 32
  • 136
  • 233
2
votes
1 answer

OpenOffice Macro to Access Contents of a Table

I wrote a Macro, which should take two Dates (dd.mm.yyyy) as a String from a table in an OpenOffice Document (Writer, not Calc). These two Dates should be merged to this: ddmmyyyy-ddmmyyyy. This should be used as the filename then. The Table has…
Vaelor
  • 69
  • 2
  • 13
2
votes
1 answer

Can I create horizontal autofilter in OpenOffice Calc

The autofilter is sorting data vertically, but I want to filter rows horizontally. Lets say that I have the following table: 1 2 2 1 2 B A E F F B D E F F C D E F F What I can do is to set an autofilter and filter only the rows…
eroteev
  • 620
  • 1
  • 7
  • 17
1
vote
1 answer

How to overcome OutOfMemoryError for java heap space?

While processing ODS sheet with JOpenDoc API, getting OutOfMemoryError for java heap space. The processing sheet contains 6000 records. As per JProfiler, consuming memory space becoming more if records are more. How to get rid of this error without…
1
vote
1 answer

Get the formatted text of a range/cell object

I try to concatenate the formatted contents of some cells with a formula. As I cannot see a way to solve it with a pure formula I add some basic code. But I cannot figure out how to access the formatted text value out of the single cells. It seems…
jeb
  • 78,592
  • 17
  • 171
  • 225
1
vote
1 answer

How to run a formula until it meets a certain criteria?

So, I have a formula ( =INDEX(Sheet1.A1:F15,RANDBETWEEN(1,15),RANDBETWEEN(1,6)) ) that returns a random number in the sheet. But, how to run the formula until the returned number is less than or equal to 25 ? I thought of using for..next.. but…
1
vote
1 answer

getScriptProvider and createScriptProvider in Libre/Open/Collabra Office

If location="document" Then sp = ThisComponent.getScriptProvider() Else mspf = CreateUNOService("com.sun.star.script.provider.MasterScriptProviderFactory") sp = mspf.createScriptProvider("") End If That's a fairly standard example from…
david
  • 2,435
  • 1
  • 21
  • 33
1
vote
1 answer

Libreoffice Calc Basic How to append 2 decimal places by code

Declaration Dim currDoc As Object Dim currSheet As Object Dim cell As Object currDoc = ThisComponent currSheet = currDoc.sheets(0) Logic cell.Formula = cDbl(cell.Value) Desired Output 100,00
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 =…