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

--- Comment #12 from Cameron <[email protected]> ---
(In reply to Mike Kaganski from comment #11)

This is a corrected version of comment #10 which includes and explains the
"ActivationInterface" variable:

'//----------------------------------------------------//
Sub DisplayingDialogbox
        '--THIS SUB IS NECESSARY TO PROMPT THE DIALOGBOX AND MAKE THE REST OF
THE CODE WORK.

        '--THIS SECTION SOURCES LIBREOFFICE IN-HOUSE SCRIPTS (LIBRARIES) TO
MAKE THE CODE WORK. THE LIBRARIES USED ARE GROUPED INTO THE VARIABLE
"DialogboxLibrariesVariable".

        DialogLibraries.Loadlibrary("Standard")

        Dim DialogboxLibrariesVariable As Object
        DialogboxLibrariesVariable = DialogLibraries.GetByName("Standard")

        '--CREATING AND DECLARING THE DIALOGBOX INTO THE CODE (THE DIALOGBOX
ITSELF HAS ALREADY BEEN CREATED, IS NAMED "MYDIALOGBOXDISPLAY" HERE AND
CONTAINS THE TEXTBOXES USED IN THE NEXT SUB).
        Dim MyDialogbox As Object
        MyDialogbox =
DialogboxLibrariesVariable.GetByName("MYDIALOGBOXDISPLAY")

        '--THOSE TWO LINES ACTIVATES THE DIALOGBOX AND MAKE THE WHOLE CODE
WORK.
        ActivationInterface = createunodialog(MyDialogbox)
        ActivationInterface.execute
End Sub

Sub Macro
        '--DECLARING VARIABLES
        Dim MyDoc As Object
        Dim MySheet As Object
        Dim FieldA_string As String
        Dim FieldB_string As String
        MyDoc = ThisComponent
        MySheet = MyDoc.Sheets.getByName("SHEET")

        '--RETRIEVING DATA FROM DIALOGBOX. "FieldA" & "FieldB" ARE THE NAMES OF
TWO TEXTFIELDS IN MY DIALOGBOX.
        FieldA_string = ActivationInterface.getControl("FieldA").Text
        FieldB_string = ActivationInterface.getControl("FieldB").Text

        '--CONVERSION STEP. CONVERTING STRING VALUE FROM DIALOGBOX INTO DECIMAL
VALUE, COMPATIBLE WITH DECIMAL SEPARATOR.
        MySheet.getCellByPosition(1, 1).Value = CDec(FieldA_string) /
CDec(FieldB_string)

End Sub
'//----------------------------------------------------//


> Could you please see if your code works simply starting LO in safe mode; from 
> > Start Center open Tools->Macros->Edit Macros; paste your code there; and 
> running it - without anything opened first.

I cannot lunch the macro in safe mode. It does not work even if I apply default
settings in the Safe Mode options and set minimal security requirements. I will
add a GIF to illustrate my point.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to