https://bugs.documentfoundation.org/show_bug.cgi?id=101316

            Bug ID: 101316
           Summary: Macro Creates Formulas with Error 508
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Setting cell B2's formula (by means of a macro) to
    =IF(A2="",B1,B2)
results in the display in cell B2
    Error 508
Clicking on cell B2 shows the formula in the edit box which looks OK.  If I
then edit the formula by deleting the close parenthesis and pressing enter, the
display in cell B2 is as expected (no error).  Display of the formula in the
edit box is identical to the first display (the close parenthesis is there).

Detailed Steps to Reproduce:
    1. In new empty LO Spreadsheet document,
use the menu Tools>Macros>Organize Macros>LibreOffice Basic... and click on
"Untitled 1", then click on the "New" button and then the "OK" button to put
you in the macro editor, editing Module 1 of the Standard library of "Untitled
1".
    2.  Enter the following code in Sub Main:

        Dim oSheet as Object, oCell as Object
        oSheet = ThisComponent.Sheets(0)
        oCell = oSheet.getCellByPosition(1,1)
        oCell.Formula = "=IF(A2="""",B1,A2)"

    3.  Execute the code by pressing F5
    4.  The cell B2 now displays "Error 508".
    5.  Edit cell B2 to delete the last parenthesis.  The error disappears, and
the parenthesis is still there when you click on cell B2.

Versions:
The version I am now running is Fedora's 1:5.1.5.2-1.fc24.  However, I first
encountered it when running version 4.6 if I remember correctly.  When updating
to version 5 did not fix the problem, I decided to submit this bug report.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to