Function Repository Resource:

ExcelClipboardData

Source Notebook

Paste Excel data from the clipboard into a Wolfram Notebook as an array

Contributed by: Sjoerd Smit

ResourceFunction["ExcelClipboardData"][]

reads the current Excel data on the clipboard and returns it as a Wolfram array.

ResourceFunction["ExcelClipboardData"][None]

returns the data as a String.

ResourceFunction["ExcelClipboardData"][arg1,arg2,]

uses ImportString[str,arg1,arg2, …] to import the data.

Details

ResourceFunction["ExcelClipboardData"][] is equivalent to ResourceFunction["ExcelClipboardData"]["TSV"].
To read the data, a temporary notebook pops up briefly to paste the data and access it.

Examples

Basic Examples (3) 

Copy some Wolfram data into Excel:

In[1]:=
ResourceFunction["CopyAsExcelData"][{{1, 2}, {3}}]
Out[1]=

Select the data and copy it again:

Get the data back out of Excel into the notebook again:

In[2]:=
ResourceFunction["ExcelClipboardData"][]
Out[2]=

Scope (4) 

Copy different types of data:

In[3]:=
ResourceFunction["CopyAsExcelData"][{1, "Hello", Now, Today, TimeObject[], Quantity[1, "USDollars"]}]
Out[3]=

Note that currencies will be imported as numbers:

In[4]:=
ResourceFunction["ExcelClipboardData"][]
Out[4]=

Use None to just read the raw data without importing it:

In[5]:=
ResourceFunction["ExcelClipboardData"][None]
Out[5]=

Use an import format that does not parse currency tokens to keep currency data as strings:

In[6]:=
ResourceFunction["ExcelClipboardData"]["Table", "CurrencyTokens" -> None]
Out[6]=

Publisher

Sjoerd Smit

Version History

  • 1.0.0 – 08 December 2022

Related Resources

License Information