Using VBA to close a running application

  • Thread starter Thread starter macroapa
  • Start date Start date
M

macroapa

Hi,

I'd like to have some VBA code in excel that will close a running app
if it's open.

Now I've found some code that closes all apps of a type (ie kills all
instances of msaccess.exe), but I want to close just certain access
db's, not all of them.

I've tried:

killstring = "taskkll /f /fi windowtitle eq filename : database
(Access 2000 file format) - Microsoft Access"
Call Shell(killstring, vbhide)

But this doesn't seem to work.

Are there any other solutions?

Thanks
 
Hi,

I'd like to have some VBA code in excel that will close a running app
if it's open.

Now I've found some code that closes all apps of a type (ie kills all
instances of msaccess.exe), but I want to close just certain access
db's, not all of them.

I've tried:

killstring = "taskkll /f /fi windowtitle eq filename : database
(Access 2000 file format) - Microsoft Access"
Call Shell(killstring, vbhide)

But this doesn't seem to work.

Are there any other solutions?

Thanks


Hi macroapa.
See: http://support.microsoft.com/kb/210518/en-us
Regards
Eliano
 
Back
Top