Sorunuzu Sorun

mark_t isimli kullanıcının profili - etkinlik

2020-12-26 15:19:42 +0100 rozet alındı  Güzel Cevap (kaynak)
2020-08-21 21:55:06 +0100 rozet alındı  Güzel Cevap (kaynak)
2020-08-04 17:18:24 +0100 rozet alındı  Güzel Cevap (kaynak)
2020-02-06 16:51:45 +0100 rozet alındı  Güzel Cevap (kaynak)
2019-07-21 22:17:50 +0100 rozet alındı  Güzel Soru (kaynak)
2019-03-31 11:54:12 +0100 rozet alındı  Taksonomist
2019-01-28 01:37:34 +0100 rozet alındı  Ölü diriltici (kaynak)
2017-05-11 21:20:37 +0100 rozet alındı  Ünlü Soru (kaynak)
2017-03-12 08:13:31 +0100 rozet alındı  Ünlü Soru (kaynak)
2017-02-21 18:34:42 +0100 rozet alındı  Güzel Cevap (kaynak)
2017-02-19 06:20:03 +0100 rozet alındı  Ünlü Soru (kaynak)
2017-01-19 16:11:13 +0100 en iyi cevap olarak işaretlenmiş Dialog Modal with Basic IDE, Non-Modal with documents

I've noticed that if I start a dialog from a macro located in "My Macros & Dialogs", running the macro from the Basic IDE (for example using ctrl-shift-F8), then the dialog started is modal with the basic IDE and not with the active document.

This can then be a problem trying to debug the macros called from events triggered by controls in the dialog.

I can work around this problem by first setting the document active, I'm using the following to set the current document active.

StarDesktop.loadComponentFromURL(ThisComponent.URL,"_default",0,array()) ' sets focus to the document'

Is there a better method than this to set the active focus to ThisComponent?

Edit. Slightly better method to change focus from the Basic IDE to the document when starting a modal dialog. Either the DoEvents or a Wait seems to be needed to avoid the dialog still being attached to the Basic IDE.


Also is there some similar method that could create a dialog that is non-modal with documents but without it being modal with the basic IDE?

I saw this prior question how-to-make-non-modal-dialog answered by @pierre-yves-samyn, but wondered if the above behaviour could lead to some other method.

Attached contains sample dialog and macro. Untitled 29.ods

Note the macro module and dialog needs to be copied to "My Macros & Dialogs" to show the problem.

I'm using LibreOffice x64 on Windows 8.1.

Edit to add code for fake non-modal dialog created using IDE and setting the dummy document invisible. Note the dialog is not shown in the windows task bar and can become hidden behind other windows. Also reference to ThisComponent will refer to the hidden dummy document.

Sub ShowHiddenDocDialog

    Dim oDummyDoc As Object
    Dim oController As Variant

    oDummyDoc = StarDesktop.loadComponentFromURL("private:factory/scalc", "_default", 0, array())
    oController = oDummyDoc.CurrentController

    DoEvents    '   Wait for the new document to be activated'

    MySampleDialog = CreateUnoDialog(DialogLibraries.Standard.DocIdentify)

    oController.Frame.ContainerWindow.Visible = False


End Sub
2017-01-19 14:21:08 +0100 rozet alındı  Ünlü Soru (kaynak)
2016-11-22 00:07:20 +0100 soruya yorum yazıldı some of my letters/numbers do not write when I type

Which version of LibreOffice and which operating system? Is it recent problem when you changed to a new version or have you had this problem since you first installed?

2016-11-21 23:57:55 +0100 soruya yorum yazıldı LibreOffice 5.0 Important please help.

Which Operating System? Try minimizing all windows in case there is a hidden dialog box that is waiting for input. If you have more than one display, check if there is a hidden dialog on the other display, even if it is not turned on. On windows 8.1 if you click the bottom right corner of the task bar all windows will be minimized, then click LibreOffice in task bar and hopefully the hidden dialog would be shown.

2016-11-21 17:09:24 +0100 bir soru cevapladı calc - function to define cellrange

Your first expression where the column is defined in a named cell myROWA is possible using a named expression, but I think there is no way to pass an argument to a named expression so you would have to create the function data3 as a user defined function.

Unfortunately there is no way to pass cell ranges to user defined functions or to return cell ranges from a user defined function. Data from a cell range is converted to an array to pass to a function and an array of data can be returned from a function.

If you could give some information on how you plan to use the result of the expression it might be possible to help create a user defined function. For example if you plan to use =SUM(data3(E11)) then the data3 function could return an array of the data from the three sheets.

2016-11-21 14:55:18 +0100 bir soru cevapladı export excel to csv with filter options

I think you need to specify the filter and also the filter options needs to be in quotes. Note the location of quotes and ":" in the example.

"C:\Program Files (x86)\LibreOffice 5\program\soffice.exe" --nofirststartwizard --convert-to csv:"Text - txt - csv (StarCalc)":"59,34,76,2,,,true" file.xls
2016-11-19 04:12:38 +0100 cevaba yorum yazıldı Need help with conditional, calculating formulas

Could you also check the tick mark to the left of the answer if that was the correct answer, Thanks.

2016-11-18 04:47:53 +0100 soruya yorum yazıldı Need help with conditional, calculating formulas

Moved the info from your answer and comment to your question, and deleted that answer.

2016-11-18 00:05:29 +0100 soruya yorum yazıldı Basic setPropertyValue problem

Edit to place all the code inside code block.

2016-11-18 00:04:59 +0100 soru düzeltilmiş Basic setPropertyValue problem

I am attempting to set the properties for all the rows and columns in a spreadsheet (using Basic). From reading the documentation, it would seem that the following should work, however, it does not:

Dim oDoc As Object, oSheet As Object, vValue As Variant

oDoc = ThisComponent    

oSheet = oDoc.Sheets.getByName("mySheet")

vValue = False

oSheet.Rows.setPropertyValue("OptimalHeight", vValue)

oSheet.Columns.setPropertyValue("OptimalWidth", vValue)

print "height: " & oSheet.Rows.getPropertyValue("OptimalHeight") & _
      "   width: " & oSheet.Columns.getPropertyValue("OptimalWidth")

When I run the above, the value returned via the Print is always True. I have changed the vValue to String and Boolean, and have used the Boolean value directly as follows: oSheet.Rows.setPropertyValue("OptimalHeight", False)

Any ideas why this fails? Does one have to write to the Sheet for the property to take affect???

2016-11-18 00:03:25 +0100 bir soru cevapladı Basic setPropertyValue problem

I think you need to set the property for every row, example

For i = 0 to n
    oSheet.Rows(i).OptimalHeight = False
Next i

Also oSheet.Rows.getPropertyValue("OptimalHeight") only returns the status for the first row. Again you need to iterate over each row to get the status of every row.

You might use :-

oSheet.Rows.Height = oSheet.Rows.Height

Which sets OptimalHeight = False for all rows but also sets the height of all rows the same as the first row.

2016-11-17 22:41:30 +0100 cevaba yorum yazıldı Need help with conditional, calculating formulas

I don't even see it defined anywhere how much karma is needed to edit your own post. 75 to edit wiki questions, maybe it's the same to edit your own posts. I used to think it was just that new members didn't know where to find the edit button, but certainly doesn't seem to be true in this case as EarlEMelton sees the flag, close and delete.

2016-11-17 20:05:35 +0100 bir soru cevapladı Filling combobox in userform with range in spreadsheet

If the combo box is in a Dialog or Userform then you need to populate the list for the combobox in the macro that initialises the Dialog.

Simple example below expects the range to initialise the combo box list to be in a vertical column range of cells.

Sub StartDialog

    Dim oList As Object
    Dim n As Integer
    Dim i As Integer
    Dim oDialog As Variant
    Dim oData As Variant

    ' Code for initiating and showing the dialog    '   
    oDialog = CreateUnoDialog( DialogLibraries.Standard.ImportTextFormat )

    oList = oDialog.getControl("FormatList")

    oList.Text = "Select text input format from the list."

    ' Read the data list from cell range into a variant array '
    oData = ThisComponent.Sheets(0).getCellRangeByName("C7:C9").DataArray

    n = ubound(oData)

    For i = 0 to n
        oList.addItem(oData(i)(0) ,i)
    Next i

End Sub
2016-11-17 19:29:25 +0100 cevaba yorum yazıldı Need help with conditional, calculating formulas

@EarlEMelton, probably you don't have enough Karma points to edit your own questions, I know it seems stupid right? Post the attachment in an answer to your own question, then I'll copy it to your question and delete your fake answer. Did you try the suggestion to use cell format to blank zeros?

2016-11-17 06:01:44 +0100 cevaba yorum yazıldı Need help with conditional, calculating formulas

Removed the upload from the question as requested, although it does mean that now its not easy for anyone to understand what you were asking. If you can then edit your question to upload a modified file, or post it in an answer and I'll edit into your question.

2016-11-17 05:53:57 +0100 soru düzeltilmiş Need help with conditional, calculating formulas

I'm attaching a workbook with which I need help from someone more familiar with somewhat advanced formulas. I can usually hold my own with simpler math functions, but these might be called conditional formulas, for lack of a better term. A textbox on the first of two pages hopefully explains what's needed. All sensitive, identifying information has been removed. If you prefer to just give me the formulas needed and the cell ref into which they need to go, I can copy/paste, then fill down. Many TIA for any help!

Edit: Mark_T updated uploaded file from @EarlEMelton with personal data removed.


Okay, Mark_T, I see the pencil now so will attach the file. Yes, I copy/pasted your formulas, filled down, then selected all the pertinent cells, went to Format Cells and pasted the format statement. I may not be doing it right as I still see the zeros. When I go back from there to the Format Cells thing again, that format statement has changed!!! Note that I also finished taking out all the sensitive data...I think! :-) Appreciate your help so much.

A thought: Should I have pasted the format statement one at a time in each cell, rather than selecting all the calculated cells and doing so only once? I'm afraid to try anything and mess it up further but can certainly take the time to do them individually if you say that would work better. Just let me know.

2016-11-17 00:15:27 +0100 bir soru cevapladı Always open files with column type set to "Text" by default. Is this possible?

Attached contains macro and some instructions on how to use it. When you open a csv file it saves the csv file format that was used and then it can be re-used by running the command that is added to the toolbar.


2016-11-16 23:35:16 +0100 soruya yorum yazıldı Need help with conditional, calculating formulas

@EarlEMelton, the sheets 9-16 and 10-16 and YTD Summary still seem to contain names and addresses, hopefullly they are only fakes but just thought I'd bring them to your attention.

2016-11-16 23:31:41 +0100 bir soru cevapladı Need help with conditional, calculating formulas

I would suggest to use the cell number format to show blank for a zero value cell instead of using the IF formula.

From the example in cell O4 the formula would be:


And the cell number format changed to:


The added ;"" will show the zero value cells as blank.

The #Value result in O29 seems to be due to the cell P29 is ='10-16'.O32, which contains =IF(H32-I32-K32-M32+P32=0,"", H32-I32-K32-M32+P32). I think a formula that returns "" is not treated as zero.

Edit to add: Set up the formula and the cell format for O4, then copy cell O4 and paste that to the range of cells O4:O32

Set the same cell format for P4, then copy and paste special, formats only to P5:P32.

Similar change to sheet 10-16 should fix the #Value error.

2016-11-16 04:01:54 +0100 bir soru cevapladı how to drill down from a pivot table in LibreOffice Calc

Drill down functionality exists in LibreOffice Calc pivot tables if the option is enabled.

From the Pivot Table Layout dialog, expand Options (click on +) and check the box for "Enable drill to details".

Double click the count cell "15" in the example pivot table will open a new worksheet with the details of the 15 customers.

2016-11-11 20:34:29 +0100 bir soru cevapladı Copy Spreadsheet Macro

Edit: Suspect the use of dispatchURL but that might have been a sub that you did not post.

Updated version below, also tried to simplify the code a little. Hopefully it works as intended.

Option Explicit

Sub copyCurrentSheet

    Dim oController As Variant
    Dim oDocument As Variant
    Dim oDispatcher As Variant
    Dim doc1 As Variant
    Dim fileDate1 As String
    Dim fileDate2 As String
    Dim oSheet1 As Variant
    Dim oSheet2 As Variant
    Dim oSheets As Variant
    Dim oCell As Variant
    Dim y As Integer
    Dim fileNameExists As Boolean
    Dim printerOption(0) AS NEW

    fileDate2 = format(Date, "MMM D, YYYY")
    fileDate1 = fileDate2

    doc1 = ThisComponent 
    oSheet2 = doc1.CurrentController.ActiveSheet

    oSheets = doc1.getSheets()

    y = 0
    fileNameExists = True

    Do While fileNameExists
        If oSheets.hasByName(fileDate1) Then
            y = y + 1 
            fileDate1 = fileDate2 & " " & y
            fileNameExists = False
        End If

    oController = doc1.getCurrentController
    oDocument   = oController.Frame
    oDispatcher = createUnoService("")

    oDispatcher.executeDispatch(oDocument, ".uno:SelectAll", "", 0, array())
    oDispatcher.executeDispatch(oDocument, ".uno:Copy", "", 0, array())

    doc1.getSheets().insertNewByName(fileDate1, 0) 

    oSheet1 = doc1.getSheets().getByIndex(0)

    oDispatcher.executeDispatch(oDocument, ".uno:Paste", "", 0, array())

    printerOption(0).Name = "PaperOrientation" 
    printerOption(0).Value = 
    doc1.Printer = printerOption()

    oSheet1.Printareas = oSheet2.Printareas

    ' freezes active sheet '

    oCell = oSheet1.getCellRangeByName("F1") 
    oCell.Value = DateValue(Now)
    oCell.NumberFormat = 75"C4"))

End Sub
2016-11-11 06:29:59 +0100 bir soru cevapladı Numerical Sorting

Suspect the numbers are being considered by Calc as text and therefore sorted by alphabetic order instead of numeric.

If you have locale where "," is the decimal separator, then when you enter "1." this will be treated as text and not a number. Solution would be to enter "1", "2" etc instead of "1.", "2." etc.

Other possible cause is if data is imported from csv files with incorrect choice of format for the column of data.

Use "View", "Value Highlighting" to show numeric data in blue and text in black to confirm your data is entered correctly.

2016-11-10 17:30:42 +0100 cevaba yorum yazıldı automatic update/refresh of all pivot tables at file opening: how?

You might also add the macro to the toolbar so you can easily refresh all the pivot tables after you have entered new data instead of closing and re-opening the document. Use Tools, Customise..., select the Toolbar tab, select save in the document instead of save in Calc as you only need to use this for the document that has pivot table. Scroll to the end of the list of commands, click on Add, in category under LibreOffice Macros, find the macro and then click on Add.

2016-11-09 22:47:08 +0100 cevaba yorum yazıldı calc - find value in subtable

If the first column of the table is not sorted, you might want to add a fourth argument of 0. =VLOOKUP(E29,$I$33:$N$39,MATCH(F29,$J$32:$N$32,0)+1,0)

2016-11-09 22:45:15 +0100 cevaba yorum yazıldı calc - find value in subtable

@DiesNuts, sorry but I thought it would be easily understood when you saw the formula. Match will search the column headers and return the position of the match to F29, this gets the correct column from the table after we add 1. Then Vlookup searches the table to find the row where the first column matches E29 and returns the value found in the column specified by the match function.

2016-11-09 20:07:38 +0100 bir soru cevapladı calc - find value in subtable

Use VLOOKUP where MATCH is used to find the column.


Where E29 is 550 and F29 is 48.

2016-11-09 02:55:47 +0100 cevaba yorum yazıldı How to concatenate two ranges?

Or you could set A6 = -M7, and then change the format to white text on white background so it is not visible, or hide row 6.

2016-11-09 02:20:13 +0100 cevaba yorum yazıldı How to concatenate two ranges?

I think the XIRR function expects a single column of data, you could create a helper column, that would assemble the values into a single column. Maybe hide that column so it is not visible.

2016-11-08 18:11:14 +0100 bir soru cevapladı Are there currently any projects underway to provide porting of vba to LibreOffice Basic?

LibreOffice can open Excel .xls files with some limited support for the contained VBA code. I doubt it would even be close to handling a VBA project of 10,000 lines.

LibreOffice Basic and VBA are very similar, but the difference between Excel Objects and LibreOffice UNO Objects and structures is what makes the conversion difficult.

I think you should consider some other programming language for your 10,000 line project, perhaps using LibreOffice Calc only as an interface to the user for input and output. I'm working on something similar, trying to use this as an opportunity to restructure the whole project and making very slow progress.

I use LibreOffice for new work, but keep Excel available until no longer needed. It still ties me to Windows but hopefully I can break the tie in a few years.

2016-11-08 10:14:50 +0100 rozet alındı  Güzel Cevap (kaynak)
2016-11-08 05:33:44 +0100 soruya yorum yazıldı In Writer, can I delete all text which has the same style?

I deleted your duplicate post to avoid confusion.

2016-11-08 05:26:23 +0100 soruya yorum yazıldı In Writer, can I delete all text which has a specific style?
2016-11-08 05:22:21 +0100 bir soru cevapladı In Writer, can I delete all text which has the same style?

You can do this from the Find and Replace dialog.

From the Menu "Edit", "Find & Replace..." or press ctrl+h.

Expand "Other Options" and select "Paragraph Styles".

From the "Find" drop down list select the style "Scene Header".

Click on "Find All". This selects all text with the selected paragraph style.

Use the "Del" key to delete the selected text.

2016-11-08 04:53:32 +0100 bir soru cevapladı How to concatenate two ranges?

Use the tilde "~" to concatenate two ranges, example


I've never used the XIRR function and don't really understand from your description what you are trying to accomplish.

2016-11-07 19:36:09 +0100 bir soru cevapladı Automatically load last edited file

Which version of LibreOffice and which OS are you using?

If you have a version of windows and recent version of LibreOffice, then the default install creates a LibreOffice shortcut on the desktop, which can also be added to the start menu, starting LibreOffice from the shortcut will show the recent files that were used which can be selected by a single click on the preview image.

It's probably similar on other OS, key is to start libre office using soffice instead of scalc, swriter etc.