View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default Start Word within Excel 2007

Hi Ralf,

Try:


'==========
Public Sub Tester()
Dim myWord As Word.Application
Dim Dokument As Word.Document

On Error Resume Next
Set myWord = GetObject(, "Word.Application")
On Error GoTo 0

If myWord Is Nothing Then
Set myWord = CreateObject("Word.Application")
End If

myWord.Visible = True

'your code

myWord.Quit
Set myWord = Nothing
End Sub
'==========



---
Regards.
Norman


"Ralf Escher" wrote in message
...
Hello!

The following code worked fine with Excel 2000:

Dim myWord As Word.Application
Dim Dokument As Word.Document
Set meinWord = GetObject(, "Word.Application")

If myWord Is Nothing Then
Set myWord = CreateObject("Word.Application")
End If

Excel 2003 & 2007 doesn't accept this code.
Dim myWord As Microsoft.Office.Interop.Word.Application
also doesn't works.

How can I register/assign Microsoft.Office.Interop?
Can't find it at my Excel 2007 Add-Ins.

Thanks for any hints
Ralf