Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I delete documents from the start list in word and excel? | Excel Discussion (Misc queries) | |||
MS Word and MS Excel won't open from the START menu. | Excel Discussion (Misc queries) | |||
Office 2007 Configuration wizard runs every time I start anyApplication (word, excel, etc) | Setting up and Configuration of Excel | |||
Lost Excel and Word from our Start/All Programs menu | Excel Discussion (Misc queries) | |||
Using Excel to start a merge session in Word | Excel Programming |