Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reporting using Excel, Excel remains open
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00765514
Message ID:
00765926
Views:
47
Have you ever tried KillExcel ?
I saw it on one of the threads a couple of months ago.

PROCEDURE KillExcel
LOCAL lnHandle , lnIsVisible
DECLARE LONG FindWindow IN WIN32API ;
STRING lpClassName, STRING lpWindowName

lnHandle = FindWindow( "XLMAIN", NULL )

IF lnHandle > 0
DECLARE LONG IsWindowVisible IN WIN32API LONG hwnd

lnIsVisible = IsWindowVisible( lnHandle )

IF lnIsVisible = 0

DECLARE LONG PostMessage IN WIN32API ;
LONG hwnd, LONG wMsg, LONG wParam, LONG lParam

PostMessage( lnHandle, 0x10, 0, 0)

*!* WAIT WINDOW "Killed an Excel Instance" TIMEOUT 1
ENDIF
ENDIF
ENDPROC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform