` Closing Excel from Clarion (Ville Vahtera) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Windows API: Closing Excel from Clarion
2003-05-01 -- Ville Vahtera
 
> I use an OLE object to start Excel. When I call Quit Excel application > disappears, but I still see it in process list. > If I call the code several time it will start a new instance of Excel each > time. Try this example. PROGRAM MAP module('winapi$X¹Y…¡Ñcreate}='Excel.Application' ?Ole1{'woÜ›?ole1{'cells(1,1).value'} Accept Case Event() Of Event:CloseWindow !TitleString = 'Microsoft Excel - Book1' TitleString = 'Microsoft Excel' WindowHandle=FindWindow(0,Address(TitleString)) If WindowHandle PostMessage(WindowHandle,WM_Close,0,0) Else Message('Application with text not found to be running > ' & TitleString ) End Destroy(?Ole1) End END HTH, -Ville


Today is November 21, 2024, 3:42 am
This article has been viewed 35342 times.
Google search has resulted in 170 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: