View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pikus pikus is offline
external usenet poster
 
Posts: 1
Default Accessing Word from Excel

I want to know more about creating a word document using VBA in Excel.
So far I've come up with this:

Private Sub CommandButton1_Click()
Dim wrd As Word.Document
Application.ActivateMicrosoftApp (xlMicrosoftWord)
Set wrd = Word.Application.ActiveDocument
With Word.Application
wrd.Selection.TypeText "HI!"
End With
End Sub

But "ActiveX component can't create object" for this line:
Set wrd = Word.Application.ActiveDocument

Then I get "Object doesn't support this property or method" for This
line:
wrd.Selection.TypeText "HI!"

Any help is greatly appreciated - Pikus


---
Message posted from http://www.ExcelForum.com/