Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Start Word within Excel 2007

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Start Word within Excel 2007

Hi Norman,



thanks for the hint.

The problem is: my Excel VBA doesn't know the object "Word" or
"Microsoft.Office.Interop"



I have no idea how to register any Word or Office Automation Servers to add
this kind of objects.

Programming with my previous Excel 2000 worked find with "Word.Application".

But Excel 2007 doesn't know this object.



Normally I access the Microsoft Word x.0 Object Library in my application
but I can't find it in Excel 2007.



Thanks

Ralf



"Norman Jones" schrieb im Newsbeitrag
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Start Word within Excel 2007

Hi Ralf,

===========
[...]
Normally I access the Microsoft Word x.0 Object Library in my application
but I can't find it in Excel 2007.

===========

I tested the code under Excel 2007 and
I added a reference to the:

Microsoft Word 12.0 Object Library



---
Regards.
Norman

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Start Word within Excel 2007 [SOLVED]

Problem solved due to the hint of Norman in another message (accessing
Outlook).

I only had to add the Word Object Library in Excel 2007

VBA - Extras - References

Thanks
Ralf




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Start Word within Excel 2007 [SOLVED]

Hi Ralf,

============
[...]
VBA - Extras - References
============


In my English version, it would be:

VBA - Tools - References


I am glad that you have resolved your problem!


---
Regards.
Norman

"Ralf Escher" wrote in message
...
Problem solved due to the hint of Norman in another message (accessing
Outlook).

I only had to add the Word Object Library in Excel 2007

VBA - Extras - References

Thanks
Ralf


Reply
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
how do I delete documents from the start list in word and excel? john Excel Discussion (Misc queries) 1 April 18th 10 03:36 PM
MS Word and MS Excel won't open from the START menu. OHL101 Excel Discussion (Misc queries) 2 August 24th 09 08:52 PM
Office 2007 Configuration wizard runs every time I start anyApplication (word, excel, etc) [email protected] Setting up and Configuration of Excel 1 January 15th 08 07:44 PM
Lost Excel and Word from our Start/All Programs menu caswb Excel Discussion (Misc queries) 2 April 8th 07 04:42 PM
Using Excel to start a merge session in Word luthor Excel Programming 0 April 20th 06 09:26 AM


All times are GMT +1. The time now is 03:02 PM.

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

About Us

"It's about Microsoft Excel"