Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference Excel cells in Word

Does anyone know of a pre-packaged solution for referencing Excel cells directly in a Word document?

For example,

                                                         {[TestExcel]Tab1!A1} 

Dear Mr. {[TestExcel]Tab1!A2},

Our systems have alerted us that your account {TestExcel]Tab1!AccountNumber} is overdue. Please remit payment of {TestExcel]Tab1!PaymentDue} immediately.

This example uses a hypothetical { } syntax, where the contents are standard Excel formula.

Every solution I've seen uses custom VBA to accomplish this. It seems like an extremely common need for which there should be some good 3rd party software available that lets non-technical users accomplish this task.

As indicated in the example above both named ranges and standard cell references would need to be supported.

like image 226
MgSam Avatar asked Mar 12 '13 20:03

MgSam


2 Answers

While Will's solution indeed links from the Cell objet, the content is inserted as a picture.

In the same dialog, selecting "Unformatted Unicode Text" instead will link and insert only the cell's content, which is desirable if you apply custom formatting on your text.

Unfortunately, this action only works for a single cell. Copying multiple cells will result in a text block with individual cell content seperated by tabs or line skip, with the entire block considered linked and entire. The solution is to link individual cells using this method.

This can become tedious if you plan on linking large portions of table from Excel, as for every cell the dialog must be invoked. It can be sped up by using hotkeys, but the sequence gets tedious:

alt,h,v,s, then alt+l, tab, , and finally Enter

Obviously this is not practial for large numbers of cells. A AutoHotkey script can help but it third party grafted solution, on par with using VBA scripts.

like image 181
Blkbox Avatar answered Sep 25 '22 23:09

Blkbox


I tried @Green Demon's method, but the two Paste Options listed were not present for me (Office 2013). I only had Keep Source Formatting, Merge Formatting, and Keep Text Only. However, I poked around and found the Paste Special, which was hidden on the Ribbon

The instructions are as follows:

  1. Copy the Excel range.
  2. Go to your Word document, and left click where you want to paste the Excel range.
  3. Click on Paste Special from the Ribbon as shown below, or type Ctrl+Alt+V.

Location of Paste Special on the Word 2013 Ribbon

  1. Click on the Paste link radio button.
  2. Click on Microsoft Excel Worksheet Object. The Paste Special dialog box should look something like this:

Paste Special Dialog Box

  1. Click OK.

The range should now be pasted in your document, and if you save, close, and re-open the Word document, you will be prompted about whether or not you want to "update this document with the data from the linked files," which works the same way as it does if you're doing Excel-to-Excel linking.

This feature is fantastic, and I'm so happy to have found it today. However, in my brief experience using it, having these Word-to-Excel links dramatically increases the amount of time it takes to open your Word document, even before it prompts you about updating. After that, the act of updating the Excel links takes much longer than it would if you were doing the same linking Excel-to-Excel. All of my work is done on network-share files, so YMMV.

like image 39
Will Ediger Avatar answered Sep 21 '22 23:09

Will Ediger