libreoffice-basic

LibreOffice macro showing simple TextBox shape

╄→尐↘猪︶ㄣ 提交于 2021-02-11 16:07:52
问题 I cannot figure out (or find an example) how to perform the following simple thing in the LibreOffice Calc 6.2: I have a drawing shape (e.g. a simple rectangle) in a sheet (call it ShapeA) and a textbox shape in another sheet (call it TextboxB). I want to do the following: when I click on the ShapeA, the TextboxB must appear on the screen (without changing the current sheet, maybe in a dialog box) and then be closed with a mouse click. I guess the macro associated with ShapeA could look

LibreOffice macro showing simple TextBox shape

别说谁变了你拦得住时间么 提交于 2021-02-11 16:04:47
问题 I cannot figure out (or find an example) how to perform the following simple thing in the LibreOffice Calc 6.2: I have a drawing shape (e.g. a simple rectangle) in a sheet (call it ShapeA) and a textbox shape in another sheet (call it TextboxB). I want to do the following: when I click on the ShapeA, the TextboxB must appear on the screen (without changing the current sheet, maybe in a dialog box) and then be closed with a mouse click. I guess the macro associated with ShapeA could look

LibreOffice macro showing simple TextBox shape

﹥>﹥吖頭↗ 提交于 2021-02-11 16:04:06
问题 I cannot figure out (or find an example) how to perform the following simple thing in the LibreOffice Calc 6.2: I have a drawing shape (e.g. a simple rectangle) in a sheet (call it ShapeA) and a textbox shape in another sheet (call it TextboxB). I want to do the following: when I click on the ShapeA, the TextboxB must appear on the screen (without changing the current sheet, maybe in a dialog box) and then be closed with a mouse click. I guess the macro associated with ShapeA could look

two-way ANCOVA: Analysis of Covariance in LibreOffice Calc

旧街凉风 提交于 2021-01-28 22:10:03
问题 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 understanding of the method (refrence): categorical dependent variable(s) and quantitative response as it seems to only accept continuous variables! So it is kind of an ANCOVA which only accepts covariants? I'm not really sure (example). Searching the

LibreOffice how to recup the current element

蓝咒 提交于 2021-01-28 20:16:39
问题 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. 回答1: To get the currently selected shape: oSel = ThisComponent.getCurrentController.getSelection() oShape = oSel.getByIndex(0) Print oShape.getString() To iterate through all shapes in the slide, start with ThisComponent.getDrawPages() and then use XrayTool

grouping a column of categorical variable into a set of unique values

一曲冷凌霜 提交于 2020-03-25 19:13:18
问题 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 dataset: A, B, C 1. gender, age, height 2. man, 34, 180 3. woman, 23, 155 4. man, 54, 165 5. other, 37, 172 6. woman, 19, 169 Now I want to specify the column tag A or header gender in Sheet1 and get the unique values stored in an array woman, man,

How to export cell range to PDF file?

本秂侑毒 提交于 2020-01-01 06:57:12
问题 I have following code to export a sheet to a PDF file: Option Explicit Sub exportToPdf Dim document As Object Dim dispatcher As Object document=ThisComponent.CurrentController.Frame dispatcher=createUnoService("com.sun.star.frame.DispatchHelper") Dim args1(1) as new com.sun.star.beans.PropertyValue args1(0).Name = "URL" args1(0).Value = "file:///home/someuser/Desktop/exported.pdf" args1(1).Name = "FilterName" args1(1).Value = "calc_pdf_Export" dispatcher.executeDispatch(document, ".uno

How to use LibreOffice functions into Basic?

て烟熏妆下的殇ゞ 提交于 2019-12-20 02:26:07
问题 I've asked here about the good way to do so. Now I'm trying the following code found here, and get some unexpected errors. I suppose I'm not using it the correct way. Any idea ? Sub Main Dim aResult Dim aFunc Dim oRange aFunc = GetProcessServiceManager().createInstance("com.sun.star.sheet.FunctionAccess") aResult = aFunc.callFunction("SUM", Array(1, 2, 3)) ' ---- Works OK Print aResult aResult = aFunc.callFunction("MDETERM", Array(2, 5, 8)) ' ---- IllegalArgumentException Print aResult oRange

LibreOffice Calc: Access a user selected range in a macro

半世苍凉 提交于 2019-12-19 10:18:32
问题 I'm looking to convert a MS Excel Spreadsheet into a LibreOffice Calc Spreadsheet. The Excel file contains a VBA Macro that iterates over a range of cells selected by the user, the Visual Basic code simply looking like this: For Each Value In Selection ' Manipulate Value Next Value Where Selection contains the cells in the worksheet manually selected by the user. So, my question is: how can I reproduce this, accesing a user selected range of cells, in Libre Basic? 回答1: If you want to use the

Reading HTML page using Libreoffice Basic

血红的双手。 提交于 2019-12-13 08:38:47
问题 I'm new to LibreOffice Basic. I'm trying to write a macro in LibreOffice Calc that will read the name of a noble House of Westeros from a cell (e.g. Stark), and output the Words of that House by looking it up on the relevant page on A Wiki of Ice and Fire. It should work like this: Here is the pseudocode: Read HouseName from column A Open HtmlFile at "http://www.awoiaf.westeros.org/index.php/House_" & HouseName Iterate through HtmlFile to find line which begins "<table class="infobox infobox