Ask Your Question

BillC's profile - activity

2018-12-28 08:59:27 +0200 received badge  Famous Question (source)
2018-12-25 09:04:52 +0200 received badge  Famous Question (source)
2018-09-15 16:04:39 +0200 received badge  Popular Question (source)
2018-09-14 15:23:15 +0200 edited question Any way to compare image?

Any way to compare image? traffic _light.ods If the above example is opened with macros disabled and the user selects a

2018-09-14 15:23:15 +0200 received badge  Editor (source)
2018-09-14 15:10:49 +0200 commented question Any way to compare image?

Sorry, forgot the linked file is an old version, in the traffic_light.ods, each .GraphicURL needs to be changed to .Grap

2018-09-14 15:06:52 +0200 edited question Any way to compare image?

Any way to compare image? traffic _light.ods If the above example is opened with macros disabled and the user selects a

2018-09-14 15:06:14 +0200 asked a question Any way to compare image?

Any way to compare image? traffic _light.ods If the above example is opened with macros disabled and the user selects a

2018-09-14 00:12:07 +0200 commented answer .GraphicURL no longer works in 6.1.0.3

Thanks for the info!

2018-09-08 17:19:47 +0200 received badge  Notable Question (source)
2018-09-08 14:28:58 +0200 commented answer .GraphicURL no longer works in 6.1.0.3

This works! Thanks. Any idea how far back this works?

2018-09-08 14:09:17 +0200 marked best answer .GraphicURL no longer works in 6.1.0.3

traffic_light.ods

Attached is an example I found somewhere that changes the image when you select a color from a list. It worked before with 6.0.5.2, but fails with error in 6.1.0.3. I found some info saying that there has been a change but they all show examples using an image from file and I can't get it to work with images from another sheet.

The error at line 31 "ResultPicture.GraphicURL = srcImage.GraphicURL":
BASIC runtime error. An exception occurred Type: com.sun.star.lang.IllegalArgumentException Message: .

What changes do I need to make this work again?

2018-09-08 11:19:00 +0200 received badge  Popular Question (source)
2018-09-08 01:32:43 +0200 commented question .GraphicURL no longer works in 6.1.0.3

I would link to source of example if I knew where I got it, google wasn't much help.

2018-09-08 01:30:16 +0200 asked a question .GraphicURL no longer works in 6.1.0.3

.GraphicURL no longer works in 6.1.0.3 traffic_light.ods Attached is an example I found somewhere that changes the imag

2018-08-14 06:32:45 +0200 received badge  Notable Question (source)
2018-08-08 20:34:59 +0200 commented answer Lo Basic line number bug?

Thanks, found existing bug report, left comment, so maybe someone will fix it.

2018-08-08 20:33:55 +0200 marked best answer Lo Basic line number bug?

A macro over 1000 lines causes scroll glitch. (at least for me)

Test procedure:

  1. Start LO and open the BASIC editor (e.g. via macro editing from within a Calc spreadsheet)
  2. Under the View menu, activate the line number display
  3. Open (or create) a long (Over 1100 lines of code) BASIC macro file in the BASIC editor
  4. Click on line 1
  5. Scroll down past line 999 Once you get to line 998 it starts back at line 1
  6. Click on line 500
  7. Scroll down past line 999 Once you get to line 998, it starts back at line 500

Version: 6.0.5.2 Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16 CPU threads: 8; OS: Linux 3.19; UI render: default; VCL: gtk2; Locale: en-US (en_US.UTF-8); Calc: group

Is there a fix other than turning off line numbers or making shorter macros? How do I report this if it is a bug?

2018-08-08 20:05:36 +0200 received badge  Popular Question (source)
2018-08-08 16:26:56 +0200 asked a question Lo Basic line number bug?

Lo Basic line number bug? A macro over 1000 lines causes scroll glitch. (at least for me) Test procedure: Start LO an

2018-07-26 02:41:45 +0200 commented answer Calc: AutoCorrect and fractions

I was afraid that was true, had to add code for those cases to solve my problem.

2018-07-14 20:42:50 +0200 received badge  Notable Question (source)
2018-07-14 15:31:57 +0200 received badge  Popular Question (source)
2018-07-14 04:39:51 +0200 asked a question Calc: AutoCorrect and fractions

AutoCorrect and fractions Calc wants to change my fractions in cells from "1/4" to "¼" and I want to stop that for this

2018-07-11 14:43:03 +0200 received badge  Supporter (source)
2018-07-06 03:54:35 +0200 received badge  Enthusiast
2018-07-03 21:19:00 +0200 marked best answer Macro on leaving a cell

I am trying to change the Tab/Enter order of the cells in a few specific groups of a spreadsheet. The code below kinda works but only if the cell changes and you don't press arrow keys to leave. Is there a way to fix or replace this code to work even if the cell contents don't change and using Enter/Tab/Arrow keys (would still like to be able to use mouse to click elsewhere) And maybe I am an idiot, but I can't seem to get the code to properly format here after several attempts.

    Global oModifyListener
Global oCell

dim document   as object
dim dispatcher as object
dim args(1) as new com.sun.star.beans.PropertyValue

REM call this method once to set the ModifyListener.
REM to destroy the listener, call oCell.removeModifyListener( oModifyListener )
Sub SetModifyListener()
    oDoc = ThisComponent
    If NOT oDoc.SupportsService("com.sun.star.sheet.SpreadsheetDocument") Then Exit Sub
REM ( change "A1" to the cell which should trigger the callback if modified )
    Dim strCellAddress
    oModifyListener = createUnoListener("CellModify_","com.sun.star.util.XModifyListener")
    oSheet = ThisComponent.CurrentController.ActiveSheet
REM first range
    strCellAddress = "D1:D10"      REM Your Cell Address here.
    oCell = oSheet.getCellRangebyName( strCellAddress )
    oCell.addModifyListener( oModifyListener )
REM seond range    
    strCellAddress = "H1:H10"
    oCell = oSheet.getCellRangebyName( strCellAddress )
    oCell.addModifyListener( oModifyListener )
End Sub

Sub CellModify_modified( oEvent )
    Dim mycol : mycol = CurrentColumn()
    Dim myrow : myrow = CurrentRow()
    If mycol = 4 then
        If myrow = 10 then 
            goThere("E1")
        ElseIf myrow < 10 then
            goThere("A"+(myrow+1))
        EndIf
    Elseif mycol = 8 then
        If myrow = 10 then 
            goThere("A1")
        ElseIf myrow < 10 then
            goThere("E"+(myrow+1))
        EndIf
    EndIf       
End Sub

Sub CellModify_disposing( oEvent )
    REM not sure what this is for, just seems to spam on exit of spreadsheet
    REM Msgbox "Disposing"
End Sub

Function CurrentColumn() As Long
Dim ODoc As Object
Dim OSel As Object
oDoc = ThisComponent
oSel = oDoc.GetCurrentSelection()
If Not oSel.supportsService("com.sun.star.sheet.SheetCellRange") Then Exit Function
If (oSel.Columns().Count() > 1) Then Exit Function
CurrentColumn = oSel.CellAddress.Column()+1
End Function

Function CurrentRow() As Long
Dim ODoc As Object
Dim OSel As Object
oDoc = ThisComponent
oSel = oDoc.GetCurrentSelection()
If Not oSel.supportsService("com.sun.star.sheet.SheetCellRange") Then Exit Function
If (oSel.Rows().Count() > 1) Then Exit Function
CurrentRow = oSel.CellAddress.Row()+1
End Function


REM it would be nice if I could use coordinates instead of cell name
Sub gotoCell
   goThere("B4")
End Sub

Sub goThere(CellName As String)
   dim args(0) as new com.sun.star.beans.PropertyValue
   dim oDoc  as object
   dim dispatcher as object

   oDoc = ThisComponent.CurrentController.Frame
   args(0).Name = "ToPoint"
   args(0).Value = CellName
   dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   dispatcher.executeDispatch(oDoc, ".uno:GoToCell", "", 0, args())

End Sub
2018-07-03 21:19:00 +0200 received badge  Scholar (source)
2018-07-03 21:18:55 +0200 commented answer Macro on leaving a cell

Thanks! That looks much better, but I was having a problem if I used the ENTER key, it would get stuck on the jumped to

2018-07-03 21:18:45 +0200 commented answer Macro on leaving a cell

That looks much better, but I was having a problem if I used the ENTER key, it would get stuck on the jumped to cell. I

2018-07-03 07:53:01 +0200 received badge  Notable Question (source)
2018-07-02 23:19:21 +0200 received badge  Student (source)
2018-07-02 16:48:20 +0200 received badge  Popular Question (source)
2018-07-02 05:47:30 +0200 commented question Macro on leaving a cell

@Ratslinger Thanks for fixing it, I pressed the button and it said enter code here so I pasted it, seems I have to try t

2018-07-01 22:53:58 +0200 asked a question Macro on leaving a cell

Macro on leaving a cell I am trying to change the Tab/Enter order of the cells in a few specific groups of a spreadsheet