LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel VBA to use worksheet embedded in Word Doc

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.???????????
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded Excel worksheet is too large for a Word page. How to fix Ron092007 Excel Discussion (Misc queries) 1 July 30th 09 12:50 PM
Excel crashes worksheet with VBA and Word with embedded worksheet BRW Excel Discussion (Misc queries) 0 February 8th 08 08:22 PM
Excel with an embedded Word Doc Scream New Users to Excel 0 August 2nd 06 11:14 AM
Update cell selection of embedded worksheet in Word punch Excel Programming 0 August 17th 04 04:17 PM
excel with embedded word doc alain deloin Excel Programming 0 June 4th 04 10:25 PM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"