General discussion

Locked

Create object fails, get object is fine

By PeltyC ·
I work for a software company and we have recently encountered a problem on so far about 5 of a thousand client PC's. The software is written in vb6 and uses create object to launch word and outlook. Seemingly unexplainably it has stopped working. We can find no correlation to office version or windows version. Get object works fine once the object is created. I have searched the web, checked for latest service packs, regsvr32, checked version of what I believe to be the office automation ocx and dll's. Anyone seen this or can offer any suggestions

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Furqan Asrar In reply to Create object fails, get ...

What kind of error does it display?

Seems like the Office is not installed properly or some components are not installed. You could try removing and re-installing the Office.

Collapse -

by PeltyC In reply to

Thanks for that I agree with you and completely stripping out office and reinstalling does usually resolve it,I have noticed it is more frequent where multiple version of office are on the same machine. However it is a big sledgehammer which really does not tell me what the problem is or how to fix it. Just as you can resolve most problems by reinstalling the OS of a server or workstation but it does not feel the smartest way to go about it. As a last resort I agree but these are often small clients with minimal IT knowledge and some with minimal or not that on the ball IT support. The only error message is one generated by the programme that allows us to track to code that is causing the problem and that is createobject for both word and outlook. I have written a test app that executes only that line of code aiming to eliminate other variables. I have been unsuccessful in finding out in more detail what the vb command createobject does, what libraries it calls? The interesting thing is that these machines have been happily creating objects for months or years but something which the user is not aware of or not retelling has changed and it is something not logged in eventvwr that suddently stops this line of code being able to execute.

Collapse -

by Furqan Asrar In reply to Create object fails, get ...

Do these comps have NAV intalled by any chance? Try disabling AutoProtect.

Otherwise i'm not really sure of the root cause. I guess you would be using something like this:
Set VariableName = CreateObject(AppName)

Collapse -

by PeltyC In reply to

They are running various antivirus and I have tried stopping them at the service level in case it was some kind of virus protection kicking in. Thanks though.

Collapse -

by DSR28 In reply to Create object fails, get ...

If you are creating the object, ensure you use the name of the interface, not the clsid (guid).

For example, "Word.Application" instead of "Word.Application.10" or "{000209FF-0000-0000-C000-000000000046}" if you are just calling CreateObject.

I think if a previous version of office is installed, the new installation is careful not to clobber the registry information for the previous. If you are using a reference to the office dll, ensure that you create the reference on a machine with the office version that you are using (and try to make that the only office version on the machine).

Collapse -

by PeltyC In reply to

The code does not call a specific version of office in general works with 2000, XP or 2003. The machine on which the compiling is done has only one version of office running on it. In the sample code I created I did compile it three times with different libraries for each of the versio of office it supports but this seems to have no impact on the machines inability to execute the code. It is clear that something has gone awry in the office automation but I am really struggling to find out the details of how office automation works.

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums