Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting a range from an excel worksheet into Word

Status
Not open for further replies.

gray78

Programmer
Feb 3, 2005
78
US
I would like to know how to link a range of cells from an excel worksheet which is part of a workbook into a word document.
 
Select and copy the Excel range.

Click in the Word doc and choose Edit > Paste Special.

Choose Paste Link.

 
Thanks. I wasn't clear though. I want to be able to link a range of cells from a worksheet which is withing a workbook into a Word document.
 
Hi gray78,

With your Excel worksheet and Word document open:
. copy the source range in Excel
. select the destination point in Word
. use Edit|Paste Special, choose the 'paste link' option and whatever paste format you prefer.

Cheers

[MS MVP - Word]
 
macropod,

Thank you. The problem I am running into is that I want to create a macro to do this function. If the clipboard is empty I get an error as follows:

Run-time error '4605':
This method or property is not available because clipboard is empty or not valid.

The portion of the code in question is:

Selection.PasteSpecial link:=True, DataType:=wdPasteOLEObject, Placement:= _
wdInLine, DisplayAsIcon:=False

Any suggestions?

Gray '78
 
Hi gray78,

The simplest solution would be to precede that line with:
"on Error Resume Next"

That should also be sufficient to trap errors that result from trying to paste data from the clipboard that aren't linkable.

Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top