Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and EXCEL ActiveX Automation Problems
Message
From
28/08/1999 00:49:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00258333
Message ID:
00258762
Views:
12
>I have a batch process that builds about 50 spreadsheets every morning. VFP6 builds the Excel97 spreadsheets, and the first few always work fine. Somewhere along the way, the process crashes on me.
>
>One of two events occur: either the createobject() command fails, (which a re-start of the machine easily fixes) or Excel hangs somewhere, leaving VFP to give an ugly retry message trying to communicate with the ActiveX Excel Session. The latter of the two usually requires a few Ctrl-Alt-Deletes to shut down and a reboot.
>
>At first I thought that I was not shutting down the spreadsheet completely and freeing the memory properly.
>
>I use the following code to shut down and release the object:
>ExcelObj.Quit
>RELEASE ExcelObj
>
>I even use code from Microsoft's site to make sure the object is released:
>
>PROCEDURE xlquit
>DECLARE LONG FindWindowA IN USER32 AS FindA STRING,STRING
>DECLARE LONG SendMessageA IN USER32 AS SendA LONG, LONG, LONG, LONG
>WM_USER = 1024
>hwnd = FindA("XLMAIN", 0)
>DO WHILE hwnd > 0
> WhatD= SendA(hwnd, WM_USER + 18, 0, 0)
> y=GETOBJECT (,"Excel.Application")
> y.QUIT
> hwnd = FindA("XLMAIN", 0)
>ENDDO
>
>And I still can not get 50 spreadsheet to run in a row.
>
>Ten bucks go to the person who can help me solve this mystery.
Mark,
Should you really quit excel between spreadsheets ?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform