Macros/Calc/py018

    From The Document Foundation Wiki
    < Macros‎ | Calc
    This page is a translated version of the page Macros/Calc/py018 and the translation is 60% complete.
    Outdated translations are marked like this.
    Other languages:

    Descrizione

    Eseguite il dispatcher per inserire una formula (in realtà qualsiasi stringa) in una determinata cella

    Codice Python

    def main(args=None):
        # ~ NAME_SHEET = 'Sheet1'
        document = XSCRIPTCONTEXT.getDocument()
        sheet = document.CurrentController.ActiveSheet
    
        # ~ <span lang="en" dir="ltr" class="mw-content-ltr">If you want any other sheet</span>
        # ~ sheet = document.Sheets[NAME_SHEET]
    
        cell = sheet['B11']
        cell.Formula = '=SUM(B2:B10)'
    
        sheet['B11:D11'].fillAuto(1, 1)
    
        return