Close a Application from Access

  • Thread starter Thread starter Guest
  • Start date Start date
Hallo Markus.

Markus said:
Hallo

Is it possible to close an application from access if yes how

Yes, it is possible, for example by activating the application using
the AppActivate command and then executing SendKeys "%{F4}".
If the application is an automation server (Word or Excel), there is
an other opportunity using the GetObject function to get a reference
to the application and then using the applications method to quit the
application (mostly "quit"), for example:

Dim objWord As Object
Set objWord = GetObject(Class:="Word.Application")
objWord.Quit
Set objWord = Nothing
 
Back
Top