Modify embedded Excel workbook in Word document via VBA

后端 未结 3 911
無奈伤痛
無奈伤痛 2020-12-10 06:21

I have a Word document with two embedded Excel files (added using Insert -> Object -> Create From File) which I wish to modify using Word VBA. I have got to the point where

3条回答
  •  忘掉有多难
    2020-12-10 06:56

    Have another hackey way to get the chart to close: Simply use the find function to find something in the document that is not there.

    EG

    With Selection.Find
        .ClearFormatting
        .Text = "wiffleball"
        .Execute Forward:=True
    End With
    

    This will take you out of the embedded file, close the instance and back to the main document, you can just code from there.

    Hope this helps, this problem was driving me crazy.

提交回复
热议问题