[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

VFP Word Application OLE Errors

Asked by ramramcat in FoxPro Database

Tags: Visual Foxpro

I have a VFP-9 application on a network of about 10 users that uses a Word Application object to perform a mail merge, update a mail-merge document, print it and save it to a NEW document. The users select a master mail-merge document from a folder of documents and then process the merge-print-save. The data source for the mail-merge is a CSV file that is stored on each users local hard-drive. This CSV file is updated before each merge.
 
Very often error #1429 OLE IDispatch exception code 0 from Microsoft Word: is issued.
After the above message it says Requested object is not available... 
-OR-
This file is read-only.  (F:\COLLECT\DOCS\51 CORP DEMAND.doc) [the master documents name
-OR-
Word cannot save this file because it is already open elsewhere.  (F:\DEBTOR-DOCS\...\MEM-PBD-SETTLE.doc) [the NEW document in a different directory]

The #1429 error message has been issued with Requested object is not available... even when no other programs are running on the workstation and no other users are logged in.

Everything works in testing and sometimes, it also works in the live environment. It almost seems that a document and/or the Word object is being left open, but I ran it with the Processes page on the Windows Task manager open and I could see Winword open and then close.

The code is below.

Users are running VFP-9 (compiled EXE application), Windows-XPP, Word-2003.

Any help would be greatly appreciated.

Also, does anyone know of a GOOD source for VFP Office Automation, as every time I need to use it I end up winging it (very time consuming).

Thank you all.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
* Create/Update CSV file for Letters
Thisform.BldLett()
 
M_DocName = CLDocs.DocName
M_DocLoc = CLDocs.DocLoc
 
* Build Debtor Documents folder if not exist
IF NOT DIRECTORY(sys(5)+"\DEBTOR-DOCS\"+ALLTRIM(M_CLFILE))
  MD sys(5)+"\DEBTOR-DOCS\"+ALLTRIM(M_CLFILE) 
ENDIF 
 
* Mailmerge and print Letter
 oword = CreateObject("Word.Application")
 
* APPLICATION.OLERequestPendingTimeout = 0   		&& 0 means no busy error message
 
*** The previous line removes the switch-to error message if busy. Caused by word print dialog box being displayed
*** at the same time another item on the screen is clicked, creating a conflict. Activate line by removing *.
* APPLICATION.OLERequestPendingTimeout = 0   && 0 means no busy error message
 
     WITH oword
 
      .Documents.Open(sys(5)+ALLTRIM(M_DocLoc)+ALLTRIM(M_DocName)) 
 
      .Visible = .F.
  
      .ActiveDocument.MailMerge.Destination = 0 && new document.
      .ActiveDocument.MailMerge.Execute         && Run the merge.
           
      .Dialogs(88).show()   && Open Print dialog box in Word.
 
      .ActiveDocument.SaveAs(sys(5)+"\DEBTOR-DOCS\"+ALLTRIM(M_CLFILE)+"\"+ALLTRIM(M_DocName))
 
      .Documents.Close          
      .Application.Quit
      
     ENDWITH
[+][-]08/28/09 01:52 AM, ID: 25205807Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: FoxPro Database
Tags: Visual Foxpro
Sign Up Now!
Solution Provided By: pcelba
Participating Experts: 3
Solution Grade: A
 
[+][-]08/28/09 01:58 AM, ID: 25205836Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/28/09 02:23 AM, ID: 25205945Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/28/09 04:53 AM, ID: 25206569Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/01/09 12:01 AM, ID: 25229085Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/01/09 12:41 AM, ID: 25229270Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625