Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied when creating a Word.Application

Status
Not open for further replies.

VB400

Programmer
Sep 8, 1999
359
US

This works fine on a Win/NT box; however, I have a client who needs this code on a Win/XP box using VB6 and Office 97.

Make a reference to "Microsoft Word 8.0 Object Library"

Dim objWordApp As Word.Application
Set objWordApp = New Word.Application

The last line gets "Run-time error '70' Permission denied".

I'm logged in as the administrator.

Any ideas?

Thanks in advance! Tarek
 
Try this:

Dim Myw As Object
On Error Resume Next

' Check if Word is open
Set Myw = GetObject(, "Word.application")

' If Word is not open
If Myw Is Nothing Then
Set Myw = CreateObject("Word.Application")
Myw.Visible = True
End If Swi
 

Swi,

You didn't address the problem with Permission Denied! Regardless of New vs. CreateObject, the Permission Denied is still the problem.

Thanks anyway! Tarek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top