# Copy/paste a DataFrame into a PowerPoint table

**URL:** https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570
**Category:** Data
**Tags:** dataframes
**Created:** [June 12, 2024, 6:37pm UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570 "2024-06-12T18:37:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [June 12, 2024, 6:37pm UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570/1 "2024-06-12T18:37:47Z")

</div>

I’m looking if anyone in the community have already come with a quick/simple way to just “copy paste” a DataFrame, whose columns are all composed of real numbers, into a PowerPoint table. Would save me tons of time!!! Extra kudos if it also copies the column headers!

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [June 12, 2024, 6:39pm UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570/2 "2024-06-12T18:39:11Z")

</div>

ClipData.jl (link [here](https://github.com/pdeffebach/ClipData.jl)) is exactly what you want!

Well, maybe it’s not _exactly_ what you want, since it only grabs tab-delimited output. _Maybe_ there is a way to send html output from PrettyTables.jl to the clipboard.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [June 12, 2024, 6:55pm UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570/3 "2024-06-12T18:55:24Z")

</div>

Frikin brilliant! Note: I had to first paste the result into Excel, and then copy from Excel into PowerPoint so that PowerPoint recognizes this as a table, but that wasn’t a big deal!!!

---

<div class="post-metadata">

### Author: ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)
#### Post date: [June 12, 2024, 9:38pm UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570/4 "2024-06-12T21:38:52Z")

</div>

> [@pdeffebach](#):
>
> _Maybe_ there is a way to send html output from [PrettyTables.jl](https://juliahub.com/ui/Packages/General/PrettyTables) to the clipboard.

AFAIK it is possible to put HTML into clipboard from JavaScript, and it should be possible to call JS from Julia.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 13, 2024, 8:09am UTC](https://discourse.julialang.org/t/copy-paste-a-dataframe-into-a-powerpoint-table/115570/5 "2024-06-13T08:09:20Z")

</div>

Here’s how I do it - slightly more involved but useful to ensure updates to the Julia analysis are reflect in the PowerPoint:

1. Create an Excel file with a table that has your desired output:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe24e92fc2c4c3ad3ce77ce7ae091d06232223c4.png)

1. From the Excel, copy over your table and past it into your PowerPoint with “Paste special” (Ctrl+Alt+V). In the paste special dialogue box, select “Paste link” and “Microsoft Excel Worksheet Object”:

![image](https://global.discourse-cdn.com/julialang/original/3X/6/3/639c527985e7c403255709d14bd36df5b6cf656f.png)

1. Run your analysis, get new results, and write them into the Excel file using XLSX.jl - here’s an example where I’m changing the last number in the table:

```julia
julia> XLSX.openxlsx(excel_file, mode="rw") do xf
           sheet = xf[1]
           sheet["E9"] = 20.5
       end
20.5

```

1. In the PowerPoint, right click your table and select “Update link”:

![image](https://global.discourse-cdn.com/julialang/original/3X/a/2/a2cc19dd6851cd51cb087b7f139dd75c99ba2e9f.png)

1. Et voilà:

![image](https://global.discourse-cdn.com/julialang/original/3X/2/a/2ab4542a297b4e18b05e7649288fd0d8063b6dba.png)
