If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

VBA! Can't get process to end

Hi everyone,

I have this piece of code that unpacks a zipfileshellandwait ("C:\Wzunzip C:\test.zip C:\")

After this process is done I want to delete it withKill "C:\test.zip"

The problem is that I can not delete the zipfile because the Wzunzip process won't end. The Shellandwait funtion ensures the unpack line finishes first before resuming next code. I know this works becasue there are a few other command in between these 2 commands wich I could not do if the shellandwait function wouldn't work properly.

So here is the question:
How can I end the Wzunzip.exe process so I can delete that horrible zip file afterwords? Oh, I work with VBA.
Thank you for your time and effort.

Thank you for your time and effort to reply.
I do not know if the code you posted is the code I need because I do not fully understand it. Before I go and study this code (I like to know how al of the code works in my project) I would like to verify if it is code I need.
The app Wzunzip will close after it has done it's job but it will stay active in the background. It is only vissible active in the taskmanager. If I end the proces in the taskmanager I can delete the zip file.

I found the problem. The Shellandwait function is causing it. I will have to sort that out. Really strange the function has worked with every app exept this on. Proves that I can't take everything for granted.