# Add document to Spreadsheet via OLE This article explains how to embed a document into a spreadsheet as an OLE object with GroupDocs.Merger for Python via .NET. ## What is an OLE object? OLE stands for "Object Linking and Embedding", a Microsoft technology that lets one document carry content produced by another application. For example, an Excel spreadsheet or a PowerPoint presentation can be embedded into a document edited in a word processor. All the related data then stays in one document, which is easy to share. ## How to add an OLE object to a spreadsheet GroupDocs.Merger for Python via .NET embeds a document into a worksheet of a spreadsheet in three steps: 1. Create an [`OleSpreadsheetOptions`](https://reference.groupdocs.com/merger/python-net/groupdocs.merger.domain.options/olespreadsheetoptions/) with the path to the file to embed and the number of the worksheet to put it on. 2. Create a `Merger` with the path to the spreadsheet, and call `merger.import_document()` with the options. 3. Call `merger.save()` with the path of the result. The following example embeds a PDF file into an Excel spreadsheet: {{< tabs "add-document-to-spreadsheet-via-ole" >}} {{< tab "add_document_to_spreadsheet_via_ole.py" >}} ```python from groupdocs.merger import Merger from groupdocs.merger.domain.options import OleSpreadsheetOptions def add_document_to_spreadsheet_via_ole(): # Embed the PDF file on worksheet 2, with its top left corner in cell C3 page_number = 2 ole_options = OleSpreadsheetOptions("./embedded.pdf", page_number) ole_options.row_index = 2 ole_options.column_index = 2 with Merger("./input.xlsx") as merger: merger.import_document(ole_options) merger.save("./output.xlsx") if __name__ == "__main__": add_document_to_spreadsheet_via_ole() ``` {{< /tab >}} {{< tab "input.xlsx" >}} {{< tab-text >}} `input.xlsx` is a sample file used in this example. Click [here](https://docs.groupdocs.com/merger/python-net/_sample_files/developer-guide/import-documents/add-document-to-spreadsheet-via-ole/input.xlsx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "embedded.pdf" >}} {{< tab-text >}} `embedded.pdf` is a sample file used in this example. Click [here](https://docs.groupdocs.com/merger/python-net/_sample_files/developer-guide/import-documents/add-document-to-spreadsheet-via-ole/embedded.pdf) to download it. {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ### Explanation - **`OleSpreadsheetOptions("./embedded.pdf", page_number)`**: the file to embed and the worksheet to put it on, counting from 1. - **`row_index` and `column_index`**: the cell of the object's top left corner, counting from 0, so 2 and 2 are cell C3. ## API reference - [`Merger`](https://reference.groupdocs.com/merger/python-net/groupdocs.merger/merger/) — `import_document`, `save`. - [`OleSpreadsheetOptions`](https://reference.groupdocs.com/merger/python-net/groupdocs.merger.domain.options/olespreadsheetoptions/) — the file to embed, its worksheet, cell and size. ## See also - [Import documents]({{< ref "merger/python-net/developer-guide/import-documents/_index.md" >}}) - [Merge Excel spreadsheets]({{< ref "merger/python-net/developer-guide/merge/excel.md" >}})