-
I am trying to open word in windows 2000 vb enterprise edition, i added the ref and the lines
In Declarations :
Option Explicit
Dim ObjWord as Word.Application
And in Code:
Set objWord = New Word.Application 'the error
Everytime it hits the Set line, i get a ActiveX error, "Cant create object", however, word loads in the process window? Whats wrong here?.. I tried rewriting the code in many other forms, such as Set Obj = CreateObject("Word.Application")
and Word.Application.9, however, none of these sollutions are helping the problem.
-
When I want to start Word form a subroutine or function I use the following code:
Code:
Public Sub ProcedureName()
Dim objWord as New Word.Application
End Sub
With this code a word session is started form one line instead of two. Now you can use objWord to control Word. Do not forget to use the command
Code:
objWord.Visible=true
in order to make it visible to the user.
:p;):D:cool: