Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
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 23, 2024, 2:07 am This article has been viewed 35345 times. Google search has resulted in 170 hits on this article since January 25, 2004.
|
|