Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Excel object inside Word document

Status
Not open for further replies.

hatchetman

Programmer
Jul 18, 2002
6
0
0
US
I am writing a Visual Basic application that needs to modify an Excel object within a MS Word document. I know how to reference the Word document, but I don't know how to reference the Excel object within the Word document reference. I copied a section of an existing Excel document and did a "Paste Special" into the Word document (as "Microsoft Excel Worksheet Object"). Then I want to pass an argument to a MS Query that is associated with the Excel part. Am I asking too much? While I'm at it, is it possible to pass an argument to a MS Query within an Excel document from Visual Basic?

so far...

Dim WordApp as Word.Application
Dim WordDoc as Word.Document
Dim ExcelApp as Excel.Application
Dim ExcelObject as ?

Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Document.Open("test.doc")

Set ExcelApp = CreateObject("Excel.Application")
Set ExcelObject = WordDoc.???????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top