Ask Your Question

BasicMacro's profile - activity

2016-01-19 18:12:38 +0100 answered a question Copy by preview SHEET

This works even if the previous day was the last day of a month (e.g 30 or 31).

Dim iValue As Integer
' Get value from previous sheet'
iValue = ThisComponent.Sheets.getByName(Day(Now()-1)).getCellByPosition(0, 0).getValue()
ThisComponent.CurrentController.ActiveSheet = ThisComponent.Sheets.getByName(Day(Now()))
' Set value in todays sheet'
ThisComponent.Sheets.getByName(Day(Now())).getCellByPosition(0, 0).setValue(iValue+1)

.getCellByPosition(nColumn, nRow)
    nColumn is the column index of the cell.
    nRow    is the row index of the cell.

Cell positions start at zero.
Examples
A1 = (0,0)
B1 = (1,0)
A2 = (0,1)
A5 = (0,4)
E8 = (4,7)

Other methods

  • .setValue(Number)
  • .setString(Text)
  • .setFormula(Formula)
2016-01-19 18:11:35 +0100 answered a question How may I turn my ODS sheet on its side?
  • With the Sidebar
    • On the right of the screen, click Properties (spanner icon).
    • Then under Page, click Orientation and change to Landscape.

If you have an old version of LibreOffice or the sidebar on the right is disabled.

  • With the Menu
    • On the top of the screen, click the menu Format, then Page...
    • In the window that pops-up, click the Page tab along the top.
    • Change Orientation to Landscape.
2016-01-18 14:18:20 +0100 answered a question Is it possible to reduce the height of the UI?
  • Click the menu Tools, then Options.
  • On the left expand LibreOffice then click View.
  • On the right, under User Interface.
    • Icon size and style only changes the Icons.
    • Scaling changes the menu.

Update: 22/Jan/2016

The height should automatically change to fit the text. Since it does not then it is likely your LibreOffice user profile is corrupted. Before resetting the whole LO user folder, try resetting the file registrymodifications.xcu

For Windows 7 the location is

%appdata%\libreoffice\4\user   (LibreOffice 4 & 5)
%appdata%\libreoffice\3\user   (LibreOffice 3)

From the Wiki - Resolving corruption in the user profile

In many cases it would be sufficient to only rename/(re)move the file registrymodifications.xcu within the user profile to reset all options to their default values, instead of moving the entire user profile directory. Doing so preserves all user installed extensions, gallery, auto-correction entries and auto-text and so on. But of course this would not help if, for example, one of the extensions or some other corrupted file was the culprit. You may want to experiment with that. But mind that this has effect on registration of macro's too, and makes that custom colors are removed (standard.soc overwritten).

2014-03-22 00:01:39 +0100 answered a question **HELP** With Auto Install .BAT file, 99% there..... params

I used "LibreOffice_4.1.5_Win_x86.msi" on 32bit Vista.

I removed the double quotes after the switch /i and also gm_o_jf_Palm, gm_o_jf_Pocketpc, gm_r_ex_Dictionary_Rs.


:15 msiexec /qn /i "F:\sws\Programs.New Setups\LibreOffice 4.2.0.msi" /l* "F:\sws\Programs.New Setups\LibO_install_log.txt" SELECT_WORD=1 SELECT_EXCEL=1 SELECT_POWERPOINT=1 REGISTER_ALL_MSO_TYPES=1 UI_LANGS=en_US RebootYesNo=No ISCHECKFORPRODUCTUPDATES=1 QUICKSTART=1 VC_REDIST=1 ADDLOCAL=ALL REMOVE=gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be,gm_r_ex_Dictionary_Bg,gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Br,gm_r_ex_Dictionary_Pt_Br,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Cs,gm_r_ex_Dictionary_Da,gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu,gm_r_ex_Dictionary_De,gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_Hu,gm_r_ex_Dictionary_It,gm_r_ex_Dictionary_Ku_Tr,gm_r_ex_Dictionary_Lt,gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,gm_r_ex_Dictionary_Ro,gm_r_ex_Dictionary_Ru,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,gm_r_ex_Dictionary_Es,gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Uk,gm_r_ex_Dictionary_Vi,gm_r_ex_Dictionary_Zu,gm_r_ex_Dictionary_Fr,gm_r_ex_Dictionary_Hr


Tips

  • Use the switch /qf to see what options are removed with REMOVE=
  • Info about command line install - Deployment_and_Migration
  • DO NOT warn if not in ODF format may need to be done post install. See the section Some tricks for post installation configuration which is at the bottom of the page in the link above.
2014-03-19 10:29:09 +0100 received badge  Teacher
2014-03-18 09:10:37 +0100 answered a question How to disable auto save method in libreoffice
  • Click on the menu "Tools", then "Options"
  • On the left click the "+" beside "Load/Save", then click "General".
  • On the right Untick "Save AutoRecovery information every ... Minutes"
2014-03-10 18:42:22 +0100 answered a question Counting/Restart Count based on another column

This only works if the numbers in column A are sorted.

  • Put 1 in cell B1 as this cell will never change.
  • In B2 put this formula.

=IF(A1=A2,B1+1,1)

How it works,

IF A1 = A2 THEN add 1 to the previous value in column B, ELSE reset the counter to 1.

2014-03-07 20:42:36 +0100 received badge  Editor (source)
2014-03-07 20:41:55 +0100 answered a question Copying part of a string after instance of a character

A less elegant way using a formula

=RIGHT(A1, LEN(A1) - (SEARCH("\",A1,SEARCH("\",A1,SEARCH("\",A1)+1)+1)) )

To find the location of the third backslash

 - Basically it searches for the location of the first backslash
 - Then it starts another search from that location to find the second backslash
 - Then another from that location to find the location of the third backslash

Using the RIGHT function

 - RIGHT( Text , Number of chars at the end of the string to keep )
2014-03-06 20:42:46 +0100 commented question again about loop in macro

Change from a single cell to a range of cells. (Change "$A$2" to "$A$2:$A$10"). It should work for you, but if you still want to loop through each cell individually, then I'll add a loop.