H
Howard Kaikow
Option Explicit
Private Sub CreateWordObjectUsingNew()
Dim appWord As Word.Application
On Error Resume Next
Set appWord = New Word.Application
If Err.Number <> 0 Then
Debug.Print Err.Number, Err.Description
Exit Sub
'-2147221231 Automation error
'ClassFactory cannot supply requested class
End If
appWord.Quit
Set appWord = Nothing
End Sub
Using either of the subs below, I am unable to create a Word object and get
the same error message in both cases.
I know that I ran analogous code successfully on 22 July 2004, with NAV
2003.
As far as I know, the only software installed since then was NAV 2004 on 24
August 2004.
Does anybody with Office 2003 and NAV 2004 see the same error?
Problem does not occur, on another systetm, with Office 2002 and NAV 2003.
Private Sub CreateWordObjectUsingCreateObject()
Dim appWord As Word.Application
On Error Resume Next
Set appWord = CreateObject("Word.Application")
If Err.Number <> 0 Then
Debug.Print Err.Number, Err.Description
Exit Sub
'-2147221231 Automation error
'ClassFactory cannot supply requested class
End If
appWord.Quit
Set appWord = Nothing
End Sub
Private Sub CreateWordObjectUsingNew()
Dim appWord As Word.Application
On Error Resume Next
Set appWord = New Word.Application
If Err.Number <> 0 Then
Debug.Print Err.Number, Err.Description
Exit Sub
'-2147221231 Automation error
'ClassFactory cannot supply requested class
End If
appWord.Quit
Set appWord = Nothing
End Sub
Using either of the subs below, I am unable to create a Word object and get
the same error message in both cases.
I know that I ran analogous code successfully on 22 July 2004, with NAV
2003.
As far as I know, the only software installed since then was NAV 2004 on 24
August 2004.
Does anybody with Office 2003 and NAV 2004 see the same error?
Problem does not occur, on another systetm, with Office 2002 and NAV 2003.
Private Sub CreateWordObjectUsingCreateObject()
Dim appWord As Word.Application
On Error Resume Next
Set appWord = CreateObject("Word.Application")
If Err.Number <> 0 Then
Debug.Print Err.Number, Err.Description
Exit Sub
'-2147221231 Automation error
'ClassFactory cannot supply requested class
End If
appWord.Quit
Set appWord = Nothing
End Sub