RAMA said:
When I have embedded an excel sheet object into a word 2007 document, how can
I read the data in the excel sheet and how can I track changes done in the
In order to track changes in an Excel Workbook, it must be shared.
An embedded worksheet cannot be shared, so you cannot track changes.
sheet using VBA. Can some one help me on this.
As for readng the data, this can be done.
Here is some code to get you going (Assuming the Embedded Excel Object is an
inline shape):
Sub OpenEmbeddedExcel()
Dim Shp As Word.InlineShape
Dim objEXl As Object
With Selection.InlineShapes(1)
If .Type = wdInlineShapeEmbeddedOLEObject Then
If .OLEFormat.ProgID = "Excel.Sheet.8" Then
.OLEFormat.Activate
Set objEXl = .OLEFormat.Object
With objEXl.ActiveSheet
'For example:
.Cells(1, 1).Value = "Test"
'Etc.
End With
End If
End If
SendKeys "{ESC}"
End With
End Sub