Sunday, February 14, 2010

Programmer - How to insert an excel chart into Word using AddOLEObject

Programmer Question

Existing code uses InlineShapes.AddOLEObject(FileName:="abc.xlsx", LinkToFile:=True, Range:=Some Word Range) to insert a worksheet into a Word document.



I need more control than this. To select a range of cells I've found that extra information after the filename can be useful, for example: FileName:="abc.xlsx!sheet1!R1C1!R20C5"



Is there a way to specify a specific chart within a worksheet? So can I specify the second chart on the worksheet as the object to link to?



Thanks.

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails