How to insert an excel chart into Word using AddOLEObject

前端 未结 2 355
时光取名叫无心
时光取名叫无心 2021-01-07 11:29

I\'m trying to create a linked OLE Object in a Word document using VB.Net.

Existing code uses InlineShapes.AddOLEObject(FileName:=\"abc.xlsx\", LinkToFile:=True, Ran

相关标签:
2条回答
  • 2021-01-07 12:10

    Thanks for your help Mark.

    I eventually figured out that if the Chart is in it's own sheet, rather than an object in Sheet1, then the AddOLEObject code works correctly with the following setting:

    FileName:="abc.xlsx!Chart1"

    I'm happy with this solution.

    0 讨论(0)
  • 2021-01-07 12:27

    A chart will either be a whole worksheet so address as per your sheet1 e.g. abc.xlsx!sheet1 or an object on a sheet so use the object name e.g. abc.xlsx!sheet1!chart_object

    0 讨论(0)
提交回复
热议问题