Translations:Macros/Python Guide/My first macro/10/it

    From The Document Foundation Wiki

    def my_first_macro_calc():

       doc = XSCRIPTCONTEXT.getDocument()
       cell = doc.Sheets[0]['A1'] # com.sun.star.sheet.XSpreadsheetDocument
       cell.setString('Ciao Mondo in Python in Calc')
       return 
    

    </syntaxhighlight>