Word Automation Error

J

johnb

Hi Guys
The last Set statement is throwing an error, "-2147417851 Automation Error.
The server threw an excelption."
I have a referrence to Word 12 in Referrences. I tried changing word in the
Referrences heirarchy without sucess. And I have valid path and Word Doc.
Where do I look next ?

Dim appWord As Word.Application
Dim doc As Word.Document
Set appWord = GetObject(, "Word.Application")
Set doc = appWord.Documents.Open(strDocName)

TIA
johnb
 
J

johnb

Hi Alex
I already have Set appWord = CreateObject("Word.Application") in an error
trap so that I don't have many instances of Word open.

eg.
Select Case Err
Case -2147022986, 429
Set appWord = CreateObject("Word.Application")
blnQuitWord = True
Resume Next........

I've tried removing the error trapping but without any success.

johnb
 
J

johnb

Alex, I found the cause of the automation error. The document I'm trying to
open has "Protect Document" switched on and is set to "Filling in forms" with
a password. When I remove the Projection I can read the document ok. The
question now is how can remove the Protection progammatically or bypass it so
that I can read the document ? Any Ideas?
 

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