VBA error when trying to create a word object in code

A

A C

Hi
We are getting a strange error when we try and run our application on
different machines. It runs perfectly on all but our laptop, on the laptop
we get an error. We have turned on the ms word 9.0 object library on both
machines.

The code is:
Dim wdApp as Object

Set wdApp = CreateObject("Word.Application")


On our laptop we get the following error:
Run-time error '-2147221231 (800440111)':

Automaton error

ClassFactory cannot supply requested class


Works fine on other computers. Can someone shed some light on what is
causing this problem?

Thanks
A
 
G

Graham Mandeno

It sounds like the Word data in the registry has become mangled.

Try to re-register it like this:

Start > Run
winword /r

If that can't find winword, try entering the full path - for example:
"C:\Program Files\Microsoft Office\Office\winword.exe" /r
 
A

A C

A C said:
Hi
We are getting a strange error when we try and run our application on
different machines. It runs perfectly on all but our laptop, on the laptop
we get an error. We have turned on the ms word 9.0 object library on both
machines.

The code is:
Dim wdApp as Object

Set wdApp = CreateObject("Word.Application")


On our laptop we get the following error:
Run-time error '-2147221231 (800440111)':

Automaton error

ClassFactory cannot supply requested class


Works fine on other computers. Can someone shed some light on what is
causing this problem?

Thanks
A

We think we have tracked the problem down. Posted here as a help to others.

It appears to be an issue with Norton AV installing a script blocker. Not
sure why just yet but on our system this blocker is attached to Word, but
not other office products (for example we can run
CreateObject("Excel.Application") without any problems). Other people have
had issues with different products.

The general recommendation out there is to delete the registry key which
invokes this, see below.
[HKEY_CLASSES_ROOT\CLSID\{000209FF-0000-0000-C000-000000000046}\InProcServer
32]
(Default)="C:\\Program Files\\Common Files\\Symantec Shared\\Script
Blocking\\ScrBlock.dll"

Once deleted the problem goes away.

NAV version differences is why we dont see this problem on other computers,
they are all running the latest NAV.

Thanks for the other ideas.

Regards
A
 

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