Permission denied on GetObject("Word.Application")

A

Alan Silver

Hello,

I have some code in a VB program that has been working fine on an NT4
box and a W2K box. I have now moved to Windows Server 2003 and the same
code is giving me an error.

I use the following code to grab a Word Application object ...

Public Function WordIsRunning() As Boolean
On Error Resume Next
WordIsRunning = (FindWindow("OpusApp", vbNullString) <> 0)
End Function

Public Sub GetWordApp(ByRef orWordApp As Object)
If WordIsRunning Then
Set orWordApp = GetObject(, "Word.Application")
Else
Set orWordApp = CreateObject("Word.Application")
End If
End Sub

On the 2003 box, if Word is already running, I get a "permission denied"
error, and if Word is not running, I get an error "Can't create ActiveX
object".

I am running as administrator, so permissions shouldn't be a problem.
Anyone any idea? TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top