Skip to content

Latest commit

 

History

History
92 lines (50 loc) · 4.39 KB

openpyxl.md

File metadata and controls

92 lines (50 loc) · 4.39 KB

OpenPyXL

Defined Name

  • Defined Names — openpyxl 2.6.2 documentation

    • The specification has the following to say about defined names:

      “Defined names are descriptive text that is used to represents a cell, range of cells, formula, or constant value.”

    • This means they are very LOOSELY DEFINED. They might contain a constant, a formula, a single cell reference, a range of cells or multiple ranges of cells across different worksheets. Or all of the above. They are defined GLOBALLY for a workbook and accessed from there defined_names attribue.

    Sample use for ranges

    • Accessing a range called “my_range”:

      my_range = wb.defined_names['my_range']
      # if this contains a range of cells then the destinations attribute is not None
      dests = my_range.destinations # returns a generator of (worksheet title, cell range) tuples
      
      cells = []
      for title, coord in dests:
          ws = wb[title]
          cells.append(ws[coord])
      

新手上路 {: #getting-started }

Properties, Custom Properties {: #properties }

安裝設置 {: #setup }

  • 安裝 openpyxl 套件即可,若需要寫出大檔,搭配 lxml 可以提昇效能。
  • 需要在檔案裡安插圖片,要再加裝 pillow 套件。

參考資料:

參考資料 {: #reference }

社群:

手冊: