D
Dan Meller
I want to be able to process a worksheet which is embedded in a Word document
using VBA code in an Excel Workbook. I have the following code which starts
Word, opens the document, and finds the field which contains the Excel
worksheet, but what property of the field can I use as a worksheet object.
Dim appWord As Word.Application
Dim wDoc As Document
Dim wFld As Field
Dim wWksht As Worksheet
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
appWord.Documents.Open _
"docdataset.doc", _
ReadOnly:=True, AddToRecentFiles:=False
Set wDoc = appWord.Documents(appWord.Documents.Count)
For Each wFld In wDoc.Fields
If wFld.Type = wdFieldEmbed Then
If Left$(wFld.Code.Text, 11) = "EMBED Excel" Then
Exit For
End If
End If
Next wFld
Set wWksht = wFld.???????????
using VBA code in an Excel Workbook. I have the following code which starts
Word, opens the document, and finds the field which contains the Excel
worksheet, but what property of the field can I use as a worksheet object.
Dim appWord As Word.Application
Dim wDoc As Document
Dim wFld As Field
Dim wWksht As Worksheet
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
appWord.Documents.Open _
"docdataset.doc", _
ReadOnly:=True, AddToRecentFiles:=False
Set wDoc = appWord.Documents(appWord.Documents.Count)
For Each wFld In wDoc.Fields
If wFld.Type = wdFieldEmbed Then
If Left$(wFld.Code.Text, 11) = "EMBED Excel" Then
Exit For
End If
End If
Next wFld
Set wWksht = wFld.???????????