Solved

Foxpro, Word 2003 Automation and Windows 7

Posted on 2014-03-07
10
907 Views
Last Modified: 2014-03-21
I have Visual Foxpro 9 that uses word automation.  We started upgrading to Windows 7 a year ago and my app has worked fine.  We just installed a new Windows 7 pc(64-bit, Pro) just like the others, installed Word 2003 and the automation does not work.  The error says "Class Definition WORD.APPLICATION is not found."  Word is installed and works fine.  My app works fine except for this:  oWord = CREATEOBJECT("Word.Application")
0
Comment
Question by:wcsoctu
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 125 total points
ID: 39912279
Then something is still wrong with the installation. 64bit office applications can be automated by VFP, I do this myself (Office 2010) and have seen others do it.

Bye, Olaf.
0
 
LVL 42

Assisted Solution

by:pcelba
pcelba earned 125 total points
ID: 39912340
Office 2003 is 32 bit application.

This behavior happens when the Office installation is incomplete or simply when the Office installation does not support automation. It is not bug in your application.

Successful Office automation requires entries (class definitions) in 32 part of the Windows Registry. Full Office installation should create them for you but it seems you don't have them...

What Word 2003 version did you install? Click-to-Run installations work fine they just do not allow automation. I am not sure if Word 2003 supports this mode but I am sure you can install Word 2003 without appropriate Registry enstries.

You may try to uninstall Word and install it again from original DVD.

My recommendation: Word 2003 is not supported already you should install newer version instead.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 39912436
I see, Pavel. You're right there is no 64bit Office2003.

What remains true is the registration of the word.application class is missing. Could it be security/trust center hiding it despite for registered automation clients? At least there is such a thing as a Trust Center with several options and settings. It's more about what Word itself allows, eg makros or add-ins, though, not about allowing or disallowing automation of Word. It may be worth looking into anyway.

Bye, Olaf.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 27

Assisted Solution

by:CaptainCyril
CaptainCyril earned 250 total points
ID: 39914241
I had a client that had the same problem. He uninstalled and reinstalled Office and it worked. It sometimes happens when you have two Offices on the same computer or when you do not completely uninstall one before installing the other.
0
 
LVL 4

Author Comment

by:wcsoctu
ID: 39943203
Sorry for the delay, work is busy.  I uninstalled and reinstalled with no change.It is a brand new pc so there was no prior install to remove.  There is only one version of office installed.  I have scoured the net with no luck.  I changed my code to use word.basic instead of word.application and things work on my test pc as always but not on the new pc.
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 250 total points
ID: 39943246
Have you tried running your application as admin?
0
 
LVL 42

Expert Comment

by:pcelba
ID: 39943264
I don't understand...

You wrote:
1) I uninstalled and reinstalled with no change.
2) It is a brand new pc so there was no prior install to remove.

Which sounds like a nonsense...

1) If you reinstalled the software which was not there did you check Windows Registry for value "Word.Application" ?

2) If there was no Word previously installed then your command
oWord = CREATEOBJECT("Word.Application")
could not work at all.

OK, more seriously.

If the problem occurs on one computer only then start from the scratch. Format C: drive, install Windows, install Office and check if everything works (and if Registry contains necessary Class definitions).

If the problem occurs on ALL Windows 7 machines then you have to consult Microsoft. The probable answer will be "Use supported Office version" (and don't use FoxPro). Of course you may test automation from other languages not only FoxPro. In other words you have to find the working solution yourself...
0
 
LVL 4

Author Comment

by:wcsoctu
ID: 39944850
It was suggested that a previous install was not completely removed, thus the comment it was brand new with no prior install to remove.  It was suggested to uninstall and reinstall, thus the comment that the reinstall made no change.  Not nonsense, but perhaps not clear enough.  I did check the registry for Word.Application and it is there.

I did find the problem though.  I use impesonation to copy a file from a secured share to the local pc.  I was using automation to grab the text and display in an edit box.  After grabbing the text, I would then revert the impersonation.  Since it seemed to be permission related, I changed my code to revert the impersonation then use automation to grab the text and it works now.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 39945009
I had a problem with automation to PowerPoint. Once I launched PowerPoint from FoxPro it had no problems. If the user launch it previously there were problems. The newer Windows have funny privileges problems.
0
 
LVL 42

Expert Comment

by:pcelba
ID: 39945305
OK, it just means the OLE Class is in the part of the Registry specific to interactive user. In other words the Office was installed for one certain user only but not for the impersonated one. Other explanation is restricted access rights for the impersonated user.

And yes, there are many undocummented settings which could affect this behavior in Windows.  The impersonated user does not see printers sometimes etc.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question