Urgent Kill Assistance


I am running a VBA routine that creates a temporary PDF file and when it is done kills it. My problem is I receive an error access denied. This is on my local C Documents Drive it is not a security issue because if I wait anywhere between 10-30 seconds the process will move forward and delete the temp file. When I export the file I am exporting it as a pdf using .ExportAsFixedFormat with OpenAfterPublish set to False. So I do not know what is taking place before the kill will recognize the file and delete it. I really do not want to use the Wait procedure as that would take too long. Is there a different approach I can take that will allow me to kill this temp file fast without waiting? Note: When I used this same code a year ago I did not have this issue. So I am not sure what has changed to cause this issue.

3 Replies
best response confirmed by heylookitsme (Contributor)


What do you do with the PDF file between its creation and the attempt to delete it?

After the temp file is created it is saved to a network folder (not my C Drive) which is what is causing the issue. The network is really slow. Your post helped solve the issue. Thanks
What I did to fix the issue was re-route the files being saved to the network to my Local Drive. Which then made everything much faster. I will copy the files over to the network when I am done.