word 执行 vba 并在文件打开后将更改保存到同一文件

问题描述 投票:0回答:0

我想在手动打开文件后激活/打开 word 中的嵌入式 excel。显示 excel 内容后,要将更改保存到 same document。但是,

ActiveDocument.Save
在此代码中没有保存更改。

Sub Document_Open()
 activateObject
 'MsgBox "activating excel object"
End Sub
Sub activateObject()
  With ActiveDocument
  Set oShape = .InlineShapes(1) 'The embedded object is the first InlineShape.
  'Set oShape = .Shapes(1) 'The embedded object is the first Shape.
  Set oOLEFormat = oShape.OLEFormat
  oOLEFormat.Open
  ActiveDocument.Save  
End With
End Sub
vba word
© www.soinside.com 2019 - 2024. All rights reserved.