マクロ/Pythonガイド/Calc/Calc範囲

    From The Document Foundation Wiki
    This page is a translated version of the page Macros/Python Guide/Calc/Calc ranges and the translation is 29% complete.

    ⇐ Return to Python Guide, Calc

    Other languages:

    範囲

    CAUTION: Copy or import function msgbox from Useful functions

    Get cell by name

    doc = XSCRIPTCONTEXT.getDocument()
        sheet = doc.CurrentController.ActiveSheet
        cell = sheet['A1']
        msgbox(cell.AbsoluteName)

    Get cell by position

    doc = XSCRIPTCONTEXT.getDocument()
        sheet = doc.CurrentController.ActiveSheet
        # Cell C6
        row = 5
        column = 2
        cell = sheet[row,column]
        msgbox(cell.AbsoluteName)

    ⇐ Return to Python Guide, Calc