Feb 16 2021 08:18 AM
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.
Feb 16 2021 08:53 AM
SolutionWhat do you do with the PDF file between its creation and the attempt to delete it?
Feb 16 2021 08:58 AM
Feb 16 2021 08:59 AM
Feb 16 2021 08:53 AM
SolutionWhat do you do with the PDF file between its creation and the attempt to delete it?