Runtime Error 91

J

John Bennett

I have a VB6 appplictaion that includes the following to do a spell check
using Word:

Dim SpellCheck As Object

Set SpellCheck = CreateObject("Word.Application")
SpellCheck.Visible = False
SpellCheck.Documents.add
SpellCheck.ActiveDocument.Select
SpellCheck.ActiveDocument.CheckSpelling

When I run using with Office Professional Word 2003 SP2 all works fine.

But I have someone who runs using the Student Edition of Word 2003 SP2 and
they always get runtime error 91 object not set error.

I have not been able to trace through but could this result simply because
the Student edition is being used?
 
W

Word Heretic

G'day John Bennett <[email protected]>,

AFAIK the student edition is identical, just the purchaser has signed
off to their student status and thus qualifies for a discount. I could
be wrong though.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Bennett reckoned:
 
J

John Bennett

The error 91 occurs because the On Error rouine gets control and does .Quit
to close things down. But the error handler gets control because the
CreateObject("Word.Application") is failing on the Student Edition. But I
am not sure why.
 
W

Word Heretic

G'day John Bennett <[email protected]>,

hmm, i wonder if said student has been a bit dodgy with his install
and if the word.application has been defined. have you asked him to
delete the installation and re-install?


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Bennett reckoned:
 
J

John Bennett

Not yet. I did confirm that Word.Application appears to be correct in his
registry HKEY_CLASSES_ROOT. But this may not mean that all is okay.

I also noted that he is running Norton NAV and script blocker has attached
itself to Word. But he disabled script blocker and the problem remained.
 
J

John Bennett

Found the problem and a solution in my situation. The problem PC had Norton
script blocker attached to Word. While this could be removed from the
registry entry this seems like a bad idea as long as Norton is installed.

But changing the CreateObject to:

Set SpellCheck = CreateObject("Word.Application", "localhost")

has resolved the issue.

No side effects in my situation as I am only using the spell check function
of MS Word.
 

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