I am new to this board. I have searched through past answers to various questions related to mine but have not succeeded in finding a solution to my problem.
What I need to do is: 1) Using vba/vb within an Excel doc, locate an Excel spreadsheet which is embedded in a Word doc. 2) Read data from its cells. 3) Store that data in the cells of the current Excel doc.
I have been able to locate the embedded Excel spreadsheet but can't see how to get it's data into the current spreadsheet's cells. Here's the code by which I have located the embedded spreadsheet:
Sub GetWordata()
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
Dim singleLine As Paragraph
Dim lineText As String
Dim word_app As word.Application
Dim wDoc As word.Document
Dim r As Integer
Dim i As Long, Rng As Range
Dim Evalue As String
.
.
.
With activeDocument
For i = .InlineShapes.Count To 1 Step -1
With .InlineShapes(i)
If Not .OLEFormat Is Nothing Then
If Split(.OLEFormat.ClassType, ".")(0) = "Excel" Then
MsgBox "Excel File"
End If
End If
End With
Next
End With
The message box in the code above displays, indicating that I have located the embedded spreadsheet.
Thanks ahead for any help.