Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to embed a Google Spreadsheet into a Google Document à la Microsoft Excel and Microsoft Word? How about a chart from a Spreadsheet?

share|improve this question
You can copy and paste a chart from your spreadsheets into a document. No luck with trying to embed the spreadsheet itself though. I have submitted this as a feature request on the Google Group for docs. – mikeschuld May 9 '12 at 20:26
up vote 26 down vote accepted

AFAIK, you can only copy and paste from the spreadsheet to the text document. The spreadsheet is inserted as a table, but they are not linked: if you change something in the Spreadsheet, it will not get reflected in the text document.

Of course, I'd absolutely love to be proved wrong!

share|improve this answer
Sadly, that does appear my only option at this point. – Al E. Jul 7 '10 at 13:33

Here is a script-based solution which allows one to insert a table with the contents from a given range within a given spreadsheet. I did not try to find a way to sync data real-time, as it didn't seem practical given potentially large volume of data that would have to be transferred with every edit to the spreadsheet. Instead, the script adds a custom menu item "update data" to the document.

The script should be bound to the document (i.e., created using Tools > Script Editor in the document menu). The spreadsheet URL, as well as the sheet and range to use, are specified within the script. To embed all the data on the sheet, replace .getRange(rangeName) with .getDataRange().

When the function updateData is first executed, it appends the table at the end of document. At subsequent runs, it updates the table in place (i.e., if more text is added after the table, the order will be preserved).

Note that cutting-pasting the table would break the updating process (the script would add a new table at the end) since the pasted copy is a new object. Instead, cut-paste the text around the table.

function onOpen() {
             .addItem('Update Data', 'updateData')

function updateData() {
  var ssUrl = ' spreadsheet url here ';
  var sheetName = 'Sheet2';   // name of sheet to use
  var rangeName = 'A1:C3';    // range of values to include 

  var values = SpreadsheetApp.openByUrl(ssUrl)
  var doc = DocumentApp.getActiveDocument();
  var body = doc.getBody();
  var ranges = doc.getNamedRanges('embeddedSheet-range');
  if (ranges.length == 0) {
    var table = body.appendTable(values);
  else {
    tableRange = ranges[0];
    table = tableRange.getRange().getRangeElements()[0].getElement();
    var ind = body.getChildIndex(table);
    table = body.insertTable(ind, values);
  var rangeBuilder = doc.newRange();
  doc.addNamedRange('embeddedSheet-range', rangeBuilder.build());

Technical notes

  1. It's also possible to sync the data every hour, in addition to manually. Just add a time-based trigger from Script Editor's Resources menu, so that it runs the function updateData.

  2. One can also adapt this script to be bound to the source spreadsheet instead. This would require changes in how the document is opened (e.g., by URL), but otherwise the logic is the same.

  3. The cumbersome part of the script is getting the handle of the existing table in the document. This requires placing it within a Named Range. Also, it is much more expedient to completely replace the table element than to mess with the entries of an existing table. Since a Named Range is immutable, it is also removed with the table it contains, and then created again, along with the new table.

share|improve this answer

An alternative is to use Google Sites, or any other content editor that allow embedding iframes content.

To embed Google spreadsheets in a page of Google Sites

  1. Create a new site or go to an existing site.
  2. Create a new page or click on Edit on an existing page.
  3. Click on Insert > Drive > Spreadsheet
  4. Select the spreadsheet
  5. Set the options
  6. Click on Save
share|improve this answer

protected by Community Apr 20 at 19:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.