TylerTand
07-25-2008, 11:09 AM
I am using Access 2003 and need a piece of code that will close an externally running program. I use a Shell command to open the program but I can't find any help on closing or killing an external program to Access. You help is greatly appreciated
Tyler
KeithG
07-25-2008, 11:16 AM
Check out the below link
http://answers.yahoo.com/question/index?qid=20080131235720AAEY1TX
PeregrinTook
07-25-2008, 11:17 AM
Hey Tyler,
I don't know if there's a safer way to do this, and I personally never use SendKeys - but I reckon this should work...?
Call CloseApp and pass in the desired Application Name as a string:
Sub CloseApp(pstrAppName As String)
AppActivate pstrAppName
Application.SendKeys "%{F4}", True
End Sub
HTH
J
TylerTand
07-25-2008, 11:54 AM
I have multiple copies of my database at different locations I can successfully use the following piece of code at my home location but at another location it doesn't work
killString = "taskkill /F /IM zapgrab2.exe"
Call Shell(killString, vbHide)
This stops a program named Zapgrab
Is Visual Basic 6 and VBA the same thing? I have searched and found code that supposedly works in VB6 but doesn't seem to work in Access 2003 using VBA.
Thanks for your help with this.
P.S. Bob (Moderator) if you want to Chim in I would appreciate it