Solved

Foxpro, Word 2003 Automation and Windows 7

Posted on 2014-03-07
10
858 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
Comment Utility
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 41

Assisted Solution

by:pcelba
pcelba earned 125 total points
Comment Utility
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
Comment Utility
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
 
LVL 27

Assisted Solution

by:CaptainCyril
CaptainCyril earned 250 total points
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 27

Accepted Solution

by:
CaptainCyril earned 250 total points
Comment Utility
Have you tried running your application as admin?
0
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
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
Comment Utility
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
Comment Utility
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 41

Expert Comment

by:pcelba
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
foxpro 9 formset issue 6 651
How to open form designer in VB6 project? 10 1,772
Fox9 and Windows 8 4 2,915
browse dates added less than a month in VFP 4 868
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…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now